Create print

This commit is contained in:
hamid zarghami
2026-02-22 12:38:19 +03:30
parent 11f8f4326b
commit f2fbd8552a
11 changed files with 137 additions and 17 deletions
+3 -3
View File
@@ -9,7 +9,7 @@ export const useGetSections = () => {
});
};
export const useGetSectionsDetail = (id: number) => {
export const useGetSectionsDetail = (id: string) => {
return useQuery({
queryKey: ["section", id],
queryFn: () => api.getSectionDetail(id),
@@ -31,7 +31,7 @@ export const useCreateSection = () => {
export const useUpdateSection = () => {
const queryClient = useQueryClient();
return useMutation({
mutationFn: ({ id, params }: { id: number; params: CreateSectionType }) =>
mutationFn: ({ id, params }: { id: string; params: CreateSectionType }) =>
api.updateSection(id, params),
onSuccess: (_, params) => {
queryClient.refetchQueries({
@@ -47,7 +47,7 @@ export const useUpdateSection = () => {
export const useDeleteSection = () => {
const queryClient = useQueryClient();
return useMutation({
mutationFn: (id: number) => api.deleteSection(id),
mutationFn: (id: string) => api.deleteSection(id),
onSuccess: () => {
queryClient.refetchQueries({
queryKey: ["sections"],