TASKS-1823 WebManager module

This commit is contained in:
Igor Martyniuk
2026-08-28 08:35:58 +00:00
parent fdb2cf3837
commit c93d8c025b
654 changed files with 26232 additions and 6075 deletions
+22
View File
@@ -0,0 +1,22 @@
import { useMutation } from '@tanstack/react-query';
import { toast } from 'sonner';
import { axiosClient } from '#infrastructure/axios';
import { ErrorResponse, SuccessMutationResponse } from '#infrastructure/reactQuery';
import { MODULE_API_ENDPOINT } from '../config/meta';
export const useUpdate = () => {
return useMutation<
SuccessMutationResponse,
ErrorResponse,
{ id: number } & Record<string, unknown>
>({
mutationFn: async (payload) => {
return axiosClient
.put<SuccessMutationResponse>(`${MODULE_API_ENDPOINT}/${payload.id}`, payload)
.then((data) => data.data);
},
onSuccess(data) {
toast.success(data.message);
}
});
};