create ticket admin

This commit is contained in:
hamid zarghami
2025-05-25 10:33:22 +03:30
parent 08d66eec06
commit 4bb95b4d08
6 changed files with 253 additions and 109 deletions
+12 -1
View File
@@ -1,6 +1,10 @@
import { useMutation, useQuery, useQueryClient } from "@tanstack/react-query";
import * as api from "../service/TicketServiec";
import { AddMessageTicketType, CreateCategoryType } from "../types/TicketTypes";
import {
AddMessageTicketType,
CreateCategoryType,
CreateTicketAdminType,
} from "../types/TicketTypes";
export const useGetTickets = (
status: string,
@@ -67,3 +71,10 @@ export const useOpenTicket = () => {
mutationFn: (id: string) => api.openTicket(id),
});
};
export const useCreateTicket = () => {
return useMutation({
mutationFn: (variables: CreateTicketAdminType) =>
api.createTicket(variables),
});
};