mirror of
https://github.com/strapi/strapi.git
synced 2025-09-22 14:59:07 +00:00
feat: return workflow count
This commit is contained in:
parent
904ac46808
commit
83aefda65a
@ -145,10 +145,15 @@ module.exports = {
|
||||
const { populate } = await sanitizedQuery.read(query);
|
||||
|
||||
const workflowService = getService('workflows');
|
||||
const workflow = await workflowService.findById(id, { populate });
|
||||
|
||||
const [workflow, workflowCount] = await Promise.all([
|
||||
workflowService.findById(id, { populate }),
|
||||
workflowService.count(),
|
||||
]);
|
||||
|
||||
ctx.body = {
|
||||
data: await sanitizeOutput(workflow),
|
||||
meta: { workflowCount },
|
||||
};
|
||||
},
|
||||
};
|
||||
|
Loading…
x
Reference in New Issue
Block a user