22 lines
463 B
JavaScript
Executable File
22 lines
463 B
JavaScript
Executable File
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) {
|
|
return db.findOneFromDef('zone', {routeId}, __dirname);
|
|
}
|
|
},
|
|
props: {
|
|
routeId: {
|
|
required: true
|
|
}
|
|
}
|
|
};
|