2023-04-19 08:16:37 +00:00
|
|
|
const Component = require(`vn-print/core/component`);
|
|
|
|
const emailBody = new Component('email-body');
|
|
|
|
const models = require('vn-loopback/server/server').models;
|
|
|
|
|
2023-03-01 09:11:22 +00:00
|
|
|
module.exports = {
|
|
|
|
name: 'greuge-wrong',
|
2023-04-19 08:16:37 +00:00
|
|
|
async serverPrefetch() {
|
|
|
|
this.url = await this.salixUrl();
|
|
|
|
|
|
|
|
if (!this.url)
|
|
|
|
throw new Error('Something went wrong');
|
|
|
|
},
|
|
|
|
components: {
|
|
|
|
'email-body': emailBody.build(),
|
|
|
|
},
|
|
|
|
methods: {
|
|
|
|
async salixUrl() {
|
|
|
|
const salix = await models.Url.findOne({
|
|
|
|
where: {
|
|
|
|
appName: 'salix',
|
|
|
|
environment: process.env.NODE_ENV || 'dev'
|
|
|
|
}
|
|
|
|
});
|
|
|
|
return salix.url;
|
2023-03-01 09:11:22 +00:00
|
|
|
},
|
2023-04-19 08:16:37 +00:00
|
|
|
clientGreugeUrl(clientId) {
|
|
|
|
return `${this.url}client/${clientId}/greuge/index`
|
2023-03-01 09:11:22 +00:00
|
|
|
},
|
2023-04-19 08:16:37 +00:00
|
|
|
},
|
|
|
|
props: {
|
|
|
|
tickets: {
|
|
|
|
type: Array,
|
2023-03-01 09:11:22 +00:00
|
|
|
required: true
|
|
|
|
},
|
|
|
|
},
|
2023-04-19 08:16:37 +00:00
|
|
|
};
|