We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 9d5ba98 commit 6e4c776Copy full SHA for 6e4c776
1 file changed
src/course-outline/data/apiHooks.ts
@@ -128,6 +128,11 @@ export const useCreateCourseBlock = (
128
queryKey: courseOutlineQueryKeys.courseDetails(getCourseKey(data.locator)),
129
});
130
await invalidateParentQueries(queryClient, variables);
131
+ // Invalidate tags count for the newly created block
132
+ // Strips "+type@<blockType>+block@<id>" to produce a course-run wildcard, e.g.
133
+ // "block-v1:org+course+run+type@vertical+block@abc" → "block-v1:org+course+run*"
134
+ const contentPattern = data.locator.replace(/\+type@.*$/, '*');
135
+ queryClient.invalidateQueries({ queryKey: ['contentTagsCount', contentPattern] });
136
// scroll to newly added block
137
setData({ id: data.locator });
138
// if newly created block is chapter or section, fetch and add it to store
0 commit comments