Skip to content

armgit / kaneo

Public Imported from GitHub
0

⚡ Project management that doesn't become the project. Boards, Gantt charts, and GitHub integration. Self-host it or use Kaneo Cloud.

fix: incorrect/missing invalidateQueries

MonsPropre6aa5f0cfac1b
diff --git a/apps/web/src/hooks/mutations/custom-field/use-create-custom-field.ts b/apps/web/src/hooks/mutations/custom-field/use-create-custom-field.ts
index 3e3a12238..f5e83903d 100644
--- a/apps/web/src/hooks/mutations/custom-field/use-create-custom-field.ts
+++ b/apps/web/src/hooks/mutations/custom-field/use-create-custom-field.ts
@@ -16,9 +16,7 @@ function useCreateCustomField() {
},
);
- void queryClient.invalidateQueries({
- queryKey: ["custom-fields", variables.projectId],
- });
+ void queryClient.invalidateQueries({ refetchType: "all" });
},
});
}
diff --git a/apps/web/src/hooks/mutations/custom-field/use-delete-custom-field.ts b/apps/web/src/hooks/mutations/custom-field/use-delete-custom-field.ts
index 8899d259a..3d5e91b29 100644
--- a/apps/web/src/hooks/mutations/custom-field/use-delete-custom-field.ts
+++ b/apps/web/src/hooks/mutations/custom-field/use-delete-custom-field.ts
@@ -15,9 +15,7 @@ function useDeleteCustomField(projectId: string) {
},
);
- void queryClient.invalidateQueries({
- queryKey: ["custom-fields", projectId],
- });
+ void queryClient.invalidateQueries({ refetchType: "all" });
},
});
}
diff --git a/apps/web/src/hooks/mutations/custom-field/use-reorder-custom-field.ts b/apps/web/src/hooks/mutations/custom-field/use-reorder-custom-field.ts
index 4272ae4d9..e679acb02 100644
--- a/apps/web/src/hooks/mutations/custom-field/use-reorder-custom-field.ts
+++ b/apps/web/src/hooks/mutations/custom-field/use-reorder-custom-field.ts
@@ -12,8 +12,8 @@ export function useReorderCustomFields() {
projectId: string;
fields: Array<{ id: string; position: number }>;
}) => reorderCustomFields(projectId, fields),
- onSuccess: async () => {
- await queryClient.invalidateQueries({ refetchType: "all" });
+ onSuccess: () => {
+ void queryClient.invalidateQueries({ refetchType: "all" });
},
});
}
diff --git a/apps/web/src/hooks/mutations/custom-field/use-set-custom-field-value.ts b/apps/web/src/hooks/mutations/custom-field/use-set-custom-field-value.ts
index 5abc597ae..97488295b 100644
--- a/apps/web/src/hooks/mutations/custom-field/use-set-custom-field-value.ts
+++ b/apps/web/src/hooks/mutations/custom-field/use-set-custom-field-value.ts
@@ -14,7 +14,7 @@ function useSetCustomFieldValue() {
setCustomFieldValue({ taskId, fieldId, value }),
onSuccess: (_data, variables: SetCustomFieldValueArgs) => {
void queryClient.invalidateQueries({
- queryKey: ["custom-field-values", variables.taskId],
+ queryKey: ["custom-field-values"],
});
if (variables.projectId) {
void queryClient.invalidateQueries({