const Component = require(`${appPath}/core/component`); const reportHeader = new Component('report-header'); const reportFooter = new Component('report-footer'); module.exports = { name: 'incoterms-authorization', async serverPrefetch() { this.client = await this.findOneFromDef('client', [this.recipientId]); this.company = await this.findOneFromDef('company', [this.companyId]); if (!this.client) throw new Error('Something went wrong'); }, computed: { issued: function() { return new Date(); } }, components: { 'report-header': reportHeader.build(), 'report-footer': reportFooter.build() }, props: { recipientId: { type: [Number, String], required: true }, companyId: { type: [Number, String], required: true } } };