Create order in admin

This commit is contained in:
hamid zarghami
2026-02-01 10:02:45 +03:30
parent 2ced4666c8
commit 5c536667b1
18 changed files with 712 additions and 4 deletions
+9
View File
@@ -0,0 +1,9 @@
import { useQuery } from "@tanstack/react-query";
import * as api from "../service/UserService";
export const useGetUsers = () => {
return useQuery({
queryKey: ["users"],
queryFn: api.getUsers,
});
};
+7
View File
@@ -0,0 +1,7 @@
import axios from "@/config/axios";
import type { UsersResponseType } from "../types/Types";
export const getUsers = async () => {
const { data } = await axios.get<UsersResponseType>(`/admin/users`);
return data;
};
+16
View File
@@ -0,0 +1,16 @@
import type { BaseResponse } from "@/shared/types/Types";
export type UserType = {
id: string;
firstName: string | null;
lastName: string | null;
phone: string;
gender: boolean;
addresse: string | null;
maxCredit: number;
isActive: boolean;
createdAt: string;
deletedAt: string | null;
};
export type UsersResponseType = BaseResponse<UserType[]>;