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

22 lines
463 B
JavaScript
Raw Normal View History

2019-11-04 12:55:20 +00:00
const db = require(`${appPath}/core/database`);
module.exports = {
name: 'zone',
async serverPrefetch() {
this.zone = await this.fetchZone(this.routeId);
if (!this.zone)
throw new Error('Something went wrong');
},
methods: {
fetchZone(routeId) {
2020-09-25 12:45:00 +00:00
return db.findOneFromDef('zone', {routeId}, __dirname);
2019-11-04 12:55:20 +00:00
}
},
props: {
routeId: {
required: true
}
}
};