updating page name and quiz name

This commit is contained in:
2024-09-23 08:35:16 -06:00
parent 158a5d82a2
commit 7af9cab7f0
6 changed files with 122 additions and 42 deletions

View File

@@ -123,15 +123,19 @@ export const useUpdatePageMutation = () => {
encodeURIComponent(moduleName) +
"/pages/" +
encodeURIComponent(pageName);
await axiosClient.put(url, page);
await axiosClient.put(url, {
page,
previousModuleName,
previousPageName,
});
},
onSuccess: (_, { moduleName, pageName }) => {
queryClient.invalidateQueries({
queryKey: localCourseKeys.page(courseName, moduleName, pageName),
});
queryClient.invalidateQueries({
queryKey: localCourseKeys.pageNames(courseName, moduleName),
});
// queryClient.invalidateQueries({
// queryKey: localCourseKeys.pageNames(courseName, moduleName),
// });
},
});
};