+4
-2
@@ -48,10 +48,12 @@ router.get('/', verifyToken, requireApprovalStep('oee:entry', 'view'), async (re
|
||||
const skip = Number(req.query.skip) || 0;
|
||||
const tab = (req.query.tab || '').trim() || null;
|
||||
const month = (req.query.month || '').trim() || null;
|
||||
const monthFrom = (req.query.monthFrom || '').trim() || null;
|
||||
const monthTo = (req.query.monthTo || '').trim() || null;
|
||||
// If a specific tab was requested but the user isn't allowed it, return none.
|
||||
if (tab && allow && !allow.includes(tab)) return res.json({ success: true, data: [] });
|
||||
const data = await store.list({ company: cq(req), tab, month, allowTabs: allow, top, skip });
|
||||
res.json({ success: true, data });
|
||||
const { data, total } = await store.list({ company: cq(req), tab, month, monthFrom, monthTo, allowTabs: allow, top, skip });
|
||||
res.json({ success: true, data, total });
|
||||
} catch (err) { res.status(500).json({ success: false, message: err.message }); }
|
||||
});
|
||||
|
||||
|
||||
Reference in New Issue
Block a user