Skip to content

Commit

Permalink
Adapt endpoint response (object collection) to entities format (array)
Browse files Browse the repository at this point in the history
The statuses endpoint returns a collection as object,
being the keys the corresponding slug of the status.
However, the entities expect to work with arrays.
Providing the key to the entity config they'll be automatically
adapted from the object collection to an array.
  • Loading branch information
oandregal committed Oct 5, 2023
1 parent 1347cec commit 96a0feb
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions packages/core-data/src/entities.js
Original file line number Diff line number Diff line change
Expand Up @@ -230,6 +230,7 @@ export const rootEntitiesConfig = [
baseURL: '/wp/v2/statuses',
baseURLParams: { context: 'edit' },
plural: 'postStatuses',
key: 'slug',
},
];

Expand Down

0 comments on commit 96a0feb

Please sign in to comment.