category ticket and group user and ...

This commit is contained in:
hamid zarghami
2025-03-01 16:41:20 +03:30
parent cfd4284cd8
commit 0cf7dede8b
14 changed files with 430 additions and 58 deletions
+15 -1
View File
@@ -1,6 +1,6 @@
import { useMutation, useQuery, useQueryClient } from "@tanstack/react-query";
import * as api from "../service/TicketServiec";
import { AddMessageTicketType } from "../types/TicketTypes";
import { AddMessageTicketType, CreateCategoryType } from "../types/TicketTypes";
export const useGetTickets = (status: string) => {
return useQuery({
@@ -36,3 +36,17 @@ export const useCloseTicket = () => {
mutationFn: (id: string) => api.closeTicket(id),
});
};
export const useCreateCategory = () => {
return useMutation({
mutationFn: (variables: CreateCategoryType) =>
api.createCategory(variables),
});
};
export const useGetCategories = () => {
return useQuery({
queryKey: ["categories"],
queryFn: () => api.getCategories(),
});
};