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

29 lines
696 B
JavaScript
Executable File

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