Skip to content

Commit

Permalink
Adjust to return only a single record
Browse files Browse the repository at this point in the history
  • Loading branch information
getdave committed May 23, 2023
1 parent b6d365c commit c5e6d39
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 0 deletions.
1 change: 1 addition & 0 deletions packages/core-data/src/resolvers.js
Original file line number Diff line number Diff line change
Expand Up @@ -605,5 +605,6 @@ export const getNavigationMenuBySlug =
async ( { resolveSelect } ) => {
await resolveSelect.getEntityRecords( 'postType', 'wp_navigation', {
slug,
per_page: 1,
} );
};
1 change: 1 addition & 0 deletions packages/core-data/src/selectors.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1282,6 +1282,7 @@ export function getNavigationMenuBySlug(
): Object | null {
const records = getEntityRecords( state, 'postType', 'wp_navigation', {
slug,
per_page: 1,
} );

if ( ! records?.length ) {
Expand Down

0 comments on commit c5e6d39

Please sign in to comment.