Skip to content

Commit ee37a01

Browse files
committed
fix: collection querykey
1 parent 8c2fe7b commit ee37a01

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

src/library-authoring/data/apiHooks.ts

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,11 @@ export const libraryAuthoringQueryKeys = {
6262
'content',
6363
'libraryBlockTypes',
6464
],
65-
collection: (collectionId?: string) => [...libraryAuthoringQueryKeys.all, collectionId],
65+
collection: (libraryId?: string, collectionId?: string) => [
66+
...libraryAuthoringQueryKeys.all,
67+
libraryId,
68+
collectionId,
69+
],
6670
};
6771

6872
export const xblockQueryKeys = {
@@ -278,7 +282,7 @@ export const useXBlockOLX = (usageKey: string) => (
278282
*/
279283
export const useCollection = (libraryId: string | undefined, collectionId: string | undefined) => (
280284
useQuery({
281-
queryKey: libraryAuthoringQueryKeys.contentLibrary(collectionId),
285+
queryKey: libraryAuthoringQueryKeys.collection(libraryId, collectionId),
282286
queryFn: () => getCollection(libraryId!, collectionId!),
283287
enabled: collectionId !== undefined && libraryId !== undefined,
284288
})

0 commit comments

Comments
 (0)