diff --git a/src/pages/requests/RequestList.tsx b/src/pages/requests/RequestList.tsx
index 99df8a3..6c3162c 100644
--- a/src/pages/requests/RequestList.tsx
+++ b/src/pages/requests/RequestList.tsx
@@ -1,7 +1,7 @@
import Filters from '@/components/Filters'
import Table from '@/components/Table'
import { type FC } from 'react'
-import { useGetRequests } from '../order/hooks/useOrderData'
+import { useGetRequests } from './hooks/useRequestData'
import moment from 'moment-jalaali'
import { Link } from 'react-router-dom'
import { Paths } from '@/config/Paths'
@@ -48,7 +48,7 @@ const RequestList: FC = () => {
{
+ return useQuery({
+ queryKey: ["requests"],
+ queryFn: api.getRequests,
+ });
+};
diff --git a/src/pages/requests/service/RequestService.ts b/src/pages/requests/service/RequestService.ts
new file mode 100644
index 0000000..e1bb5f7
--- /dev/null
+++ b/src/pages/requests/service/RequestService.ts
@@ -0,0 +1,7 @@
+import axios from "@/config/axios";
+import type { RequestResponseType } from "@/pages/requests/types/Types";
+
+export const getRequests = async () => {
+ const { data } = await axios.get("/admin/request");
+ return data;
+};
diff --git a/src/pages/requests/types/Types.ts b/src/pages/requests/types/Types.ts
new file mode 100644
index 0000000..63c6aa2
--- /dev/null
+++ b/src/pages/requests/types/Types.ts
@@ -0,0 +1,34 @@
+import type { UserType } from "@/pages/order/types/Types";
+import type { ProductType } from "@/pages/product/types/Types";
+import type { BaseResponse } from "@/shared/types/Types";
+
+export type RequestItemAttributeType = {
+ value: string;
+ attributeId: string;
+};
+
+export type RequestItemType = {
+ id: string;
+ createdAt: string;
+ deletedAt: string | null;
+ product: ProductType;
+ attributes: RequestItemAttributeType[];
+ request: string;
+ quantity: number;
+ description: string;
+ attachments: string[];
+};
+
+export type RequestStatus = "pending" | string;
+
+export type RequestType = {
+ id: string;
+ createdAt: string;
+ deletedAt: string | null;
+ user: UserType;
+ requestNumber: number;
+ status: RequestStatus;
+ items: RequestItemType[];
+};
+
+export type RequestResponseType = BaseResponse;