orders list native with status filter + seller

This commit is contained in:
hamid zarghami
2025-09-24 12:03:26 +03:30
parent c0b6f1577c
commit edf6bcfc3d
11 changed files with 864 additions and 10 deletions
+24
View File
@@ -0,0 +1,24 @@
import { useQuery } from "@tanstack/react-query";
import * as api from "../service/OrderService";
export const useGetNativeOrders = (
page: number = 1,
status: string = "all"
) => {
const { data, isLoading, error } = useQuery({
queryKey: ["orders", page, status],
queryFn: () => api.getNativeOrders(page, status),
});
return { data, isLoading, error };
};
export const useGetSellerOrders = (
page: number = 1,
status: string = "all"
) => {
const { data, isLoading, error } = useQuery({
queryKey: ["orders", page, status],
queryFn: () => api.getSellerOrders(page, status),
});
return { data, isLoading, error };
};