@crimson-education/sdk 0.3.14 → 0.3.15
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -240,7 +240,7 @@ function useAllUserTasks(missionLinkIds, enabled) {
|
|
|
240
240
|
function useTasksByRoadmapId(roadmapId, userId, enabled, filters) {
|
|
241
241
|
const client = (0, provider_1.useCrimsonClient)();
|
|
242
242
|
return (0, react_query_1.useQuery)({
|
|
243
|
-
queryKey: [...exports.taskKeys.all, "roadmap", roadmapId, userId],
|
|
243
|
+
queryKey: [...exports.taskKeys.all, "roadmap", roadmapId, userId, filters],
|
|
244
244
|
queryFn: () => __awaiter(this, void 0, void 0, function* () {
|
|
245
245
|
if (!roadmapId || !userId) {
|
|
246
246
|
return [];
|
|
@@ -333,7 +333,12 @@ function useCreateTask(options) {
|
|
|
333
333
|
queryClient.setQueryData(exports.taskKeys.list(newTodo.missionId), context.previousTasks);
|
|
334
334
|
},
|
|
335
335
|
onSettled: () => {
|
|
336
|
-
|
|
336
|
+
if (optimistic) {
|
|
337
|
+
invalidateTaskQueriesExcludingInfinite(queryClient);
|
|
338
|
+
}
|
|
339
|
+
else {
|
|
340
|
+
queryClient.invalidateQueries({ queryKey: exports.taskKeys.all });
|
|
341
|
+
}
|
|
337
342
|
},
|
|
338
343
|
});
|
|
339
344
|
}
|