const Component = require(`${appPath}/core/component`); const reportHeader = new Component('report-header'); const reportFooter = new Component('report-footer'); module.exports = { name: 'vehicle-event-expired', async serverPrefetch() { this.vehicleEvents = await this.fetchVehicleEvent(this.eventIds); if (!this.vehicleEvents) throw new Error('Something went wrong'); }, methods: { fetchVehicleEvent(vehicleEventIds) { return this.rawSqlFromDef('vehicleEvents', [vehicleEventIds]); }, }, components: { 'report-header': reportHeader.build(), 'report-footer': reportFooter.build() }, props: { eventIds: { type: [Array], required: true } } };