This commit is contained in:
m
2026-07-13 11:47:48 +02:00
parent c3bb0dd6ab
commit 0aa3549561
6 changed files with 162 additions and 22 deletions
+4 -4
View File
@@ -44,10 +44,10 @@ export function useAddTags() {
const queryClient = useQueryClient();
return useMutation({
mutationFn: ({ fileId, tags }: { fileId: string; tags: string[] }) =>
apiClient.post(`${ENDPOINTS.FILES}/${fileId}/tags`, { tags }),
onSuccess: (_, { fileId }) => {
queryClient.invalidateQueries({ queryKey: ['files', fileId] });
mutationFn: ({ fileId, tags, tagType }: { fileId: string; tags: string[]; tagType?: string }) =>
apiClient.post(`${ENDPOINTS.FILES}/${fileId}/tags`, { tags, tag_type: tagType }),
onSuccess: () => {
queryClient.invalidateQueries({ queryKey: ['files'] });
},
});
}