mirror of
https://github.com/strapi/strapi.git
synced 2025-12-28 23:57:32 +00:00
feat(review-workflow): update shape of list result
Use data attribute instead of results
This commit is contained in:
parent
fcf05cfdd0
commit
081d314423
@ -9,10 +9,10 @@ module.exports = {
|
||||
*/
|
||||
async find(ctx) {
|
||||
const workflowService = getService('workflows');
|
||||
const results = await workflowService.find({});
|
||||
const data = await workflowService.find({});
|
||||
|
||||
ctx.body = {
|
||||
results,
|
||||
data,
|
||||
};
|
||||
},
|
||||
/**
|
||||
|
||||
@ -54,8 +54,8 @@ describe('Review workflows', () => {
|
||||
|
||||
if (hasRW) {
|
||||
expect(res.status).toBe(200);
|
||||
expect(Array.isArray(res.body.results)).toBeTruthy();
|
||||
expect(res.body.results).toHaveLength(1);
|
||||
expect(Array.isArray(res.body.data)).toBeTruthy();
|
||||
expect(res.body.data).toHaveLength(1);
|
||||
} else {
|
||||
expect(res.status).toBe(404);
|
||||
expect(Array.isArray(res.body)).toBeFalsy();
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user