orders list native with status filter + seller
This commit is contained in:
@@ -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 };
|
||||
};
|
||||
Reference in New Issue
Block a user