fix the errors in dashboard
This commit is contained in:
@@ -15,19 +15,19 @@ router.use(requireCompanyAuth, requireTenant, requireSubscription)
|
||||
router.get('/summary', async (req, res, next) => {
|
||||
try {
|
||||
const { period } = parseQuery(summaryQuerySchema, req)
|
||||
ok(res, { data: await service.getSummary(req.companyId, period) })
|
||||
ok(res, await service.getSummary(req.companyId, period))
|
||||
} catch (err) { next(err) }
|
||||
})
|
||||
|
||||
router.get('/dashboard', async (req, res, next) => {
|
||||
try {
|
||||
ok(res, { data: await service.getDashboard(req.companyId) })
|
||||
ok(res, await service.getDashboard(req.companyId))
|
||||
} catch (err) { next(err) }
|
||||
})
|
||||
|
||||
router.get('/sources', async (req, res, next) => {
|
||||
try {
|
||||
ok(res, { data: await service.getSources(req.companyId) })
|
||||
ok(res, await service.getSources(req.companyId))
|
||||
} catch (err) { next(err) }
|
||||
})
|
||||
|
||||
@@ -42,7 +42,7 @@ router.get('/report', requireRole('MANAGER'), async (req, res, next) => {
|
||||
res.setHeader('Content-Disposition', `attachment; filename="report-${start}-${end}.csv"`)
|
||||
return res.send(result.csv)
|
||||
}
|
||||
ok(res, { data: result.report })
|
||||
ok(res, result.report)
|
||||
} catch (err) { next(err) }
|
||||
})
|
||||
|
||||
|
||||
Reference in New Issue
Block a user