salix/print/templates/email/claim-pickup-order/claim-pickup-order.js

31 lines
831 B
JavaScript
Executable File

const Component = require(`vn-print/core/component`);
const emailHeader = new Component('email-header');
const emailFooter = new Component('email-footer');
module.exports = {
name: 'claim-pickup-order',
components: {
'email-header': emailHeader.build(),
'email-footer': emailFooter.build()
},
async serverPrefetch() {
this.ticket = await this.fetchTicket(this.id);
if (!this.ticket)
throw new Error('Something went wrong');
console.log();
this.instructions = this.$t('description.instructions', [this.id, this.ticket.id]);
},
methods: {
fetchTicket(id) {
return this.findOneFromDef('ticket', [id]);
}
},
props: {
id: {
type: [Number, String],
required: true
}
}
};