upload org icon

This commit is contained in:
Oliver Bryan
2026-01-21 13:44:37 +00:00
parent 5f8d049de3
commit 0547ff106c
8 changed files with 250 additions and 3 deletions

View File

@@ -99,3 +99,15 @@ export function useUpdateOrganisationMemberRole() {
},
});
}
export function useUploadOrganisationIcon() {
const queryClient = useQueryClient();
return useMutation<string, Error, { file: File; organisationId: number }>({
mutationKey: ["organisations", "upload-icon"],
mutationFn: ({ file, organisationId }) => organisation.uploadIcon(file, organisationId),
onSuccess: () => {
queryClient.invalidateQueries({ queryKey: queryKeys.organisations.byUser() });
},
});
}