salix/print/templates/reports/zone/zone.js

28 lines
624 B
JavaScript
Executable File

const Component = require(`${appPath}/core/component`);
const reportBody = new Component('report-body');
module.exports = {
name: 'zone',
async serverPrefetch() {
this.zone = await this.fetchZone(this.id);
if (!this.zone)
throw new Error('Something went wrong');
},
methods: {
fetchZone(id) {
return this.findOneFromDef('zone', [id]);
}
},
components: {
'report-body': reportBody.build()
},
props: {
id: {
type: Number,
required: true,
description: 'The zone id'
}
}
};