production-evyos-systems-an.../ServicesWeb/customer/src/fetchers/custom/test/fetch.tsx

30 lines
700 B
TypeScript

"use server";
import { fetchData } from "@/fetchers/fecther";
import { urlTesterList } from "@/fetchers/index";
export const fetchTest = async ({
page,
size,
orderField,
orderType,
query,
}: {
page?: number;
size?: number;
orderField?: string[];
orderType?: string[];
query?: any;
}) => {
try {
const response = await fetchData(urlTesterList, { method: "POST", cache: false, payload: { page, size, orderField, orderType, query } });
return response.data;
} catch (error) {
console.error(error);
return {
completed: false,
data: null,
message: "No data is found",
};
}
};