mirror of
https://github.com/hex248/sprint.git
synced 2026-02-08 18:33:01 +00:00
upload org icon
This commit is contained in:
@@ -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() });
|
||||
},
|
||||
});
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user