mirror of
https://github.com/strapi/strapi.git
synced 2025-11-02 10:55:37 +00:00
Merge pull request #17222 from strapi/feature/workflow-return-count-in-meta
This commit is contained in:
commit
5f46fc52a1
@ -121,16 +121,15 @@ module.exports = {
|
|||||||
);
|
);
|
||||||
const { populate, filters, sort } = await sanitizedQuery.read(query);
|
const { populate, filters, sort } = await sanitizedQuery.read(query);
|
||||||
|
|
||||||
const workflows = await workflowService.find({
|
const [workflows, workflowCount] = await Promise.all([
|
||||||
populate,
|
workflowService.find({ populate, filters, sort }),
|
||||||
filters,
|
workflowService.count(),
|
||||||
sort,
|
]);
|
||||||
});
|
|
||||||
|
|
||||||
ctx.body = {
|
ctx.body = {
|
||||||
data: await mapAsync(workflows, sanitizeOutput),
|
data: await mapAsync(workflows, sanitizeOutput),
|
||||||
meta: {
|
meta: {
|
||||||
workflowCount: workflows.length,
|
workflowCount,
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
},
|
},
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user