Skip to content

Commit

Permalink
Prevent stale categorization of patterns after category deletion
Browse files Browse the repository at this point in the history
  • Loading branch information
aaronrobertshaw committed Oct 5, 2023
1 parent 008d6a3 commit b4e87d6
Showing 1 changed file with 7 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,14 @@ export default function DeleteCategoryMenuItem( { category, onClose } ) {
{ throwOnError: true }
);

// Prevent the need to refresh the page to get up-to-date categories
// and pattern categorization.
invalidateResolution( 'getUserPatternCategories' );
invalidateResolution( 'getEntityRecords', [
'postType',
PATTERN_TYPES.user,
{ per_page: -1 },
] );

createSuccessNotice(
sprintf(
Expand Down

0 comments on commit b4e87d6

Please sign in to comment.