category ticket and group user and ...
This commit is contained in:
@@ -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(),
|
||||
});
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user