diff --git a/src/library-authoring/create-library/data/apiHooks.test.tsx b/src/library-authoring/create-library/data/apiHooks.test.tsx index 0075bcac6..726cbee02 100644 --- a/src/library-authoring/create-library/data/apiHooks.test.tsx +++ b/src/library-authoring/create-library/data/apiHooks.test.tsx @@ -63,6 +63,9 @@ describe('create library apiHooks', () => { expect(invalidateQueriesSpy).toHaveBeenCalledWith({ queryKey: libraryAuthoringQueryKeys.contentLibraryList(), }); + expect(invalidateQueriesSpy).toHaveBeenCalledWith({ + queryKey: ['content_search'], + }); }); }); diff --git a/src/library-authoring/create-library/data/apiHooks.ts b/src/library-authoring/create-library/data/apiHooks.ts index 1f5371968..1a5880a5d 100644 --- a/src/library-authoring/create-library/data/apiHooks.ts +++ b/src/library-authoring/create-library/data/apiHooks.ts @@ -23,6 +23,8 @@ export const useCreateLibraryV2 = () => { mutationFn: createLibraryV2, onSettled: () => { queryClient.invalidateQueries({ queryKey: libraryAuthoringQueryKeys.contentLibraryList() }); + // Invalidate the search token to refresh with the new library's access_id + queryClient.invalidateQueries({ queryKey: ['content_search'] }); }, }); };