Add initial project files

This commit is contained in:
Igor Martyniuk
2026-09-01 13:03:41 +03:00
parent 22e111bb44
commit 74cb5b6176
1841 changed files with 242819 additions and 30 deletions
+18
View File
@@ -0,0 +1,18 @@
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 useCreate = () => {
return useMutation<SuccessMutationResponse, ErrorResponse, Record<string, unknown>>({
mutationFn: async (payload) => {
return axiosClient
.post<SuccessMutationResponse>(MODULE_API_ENDPOINT, payload)
.then((data) => data.data);
},
onSuccess(data) {
toast.success(data.message);
}
});
};