salix/print/templates/email/buyer-week-waste/buyer-week-waste.js

29 lines
679 B
JavaScript
Raw Permalink Normal View History

2022-09-27 05:24:45 +00:00
const Component = require(`vn-print/core/component`);
2022-11-10 08:51:28 +00:00
const emailBody = new Component('email-body');
module.exports = {
name: 'buyer-week-waste',
async serverPrefetch() {
this.wastes = await this.fetchWastes();
if (!this.wastes)
throw new Error('Something went wrong');
},
computed: {
dated: function() {
const filters = this.$options.filters;
2023-01-16 14:18:24 +00:00
return filters.date(Date.vnNew(), '%d-%m-%Y');
}
},
methods: {
fetchWastes() {
2021-04-06 11:46:38 +00:00
return this.rawSqlFromDef('wasteWeekly');
}
},
components: {
2022-11-10 09:38:54 +00:00
'email-body': emailBody.build()
},
props: {}
};