|
- import "server-only";
- // import { serverFetchJson } from "@/app/utils/fetchUtil";
- // import { BASE_API_URL } from "@/config/api";
- import { serverFetchJson } from "../../utils/fetchUtil";
- import { BASE_API_URL } from "../../../config/api";
- import { cache } from "react";
-
- interface PickOrderItemInfo {
- name: string,
- type: string,
- }
-
- export interface PickOrderResult{
- id: number,
- code: string,
- consoCode?: string,
- targetDate: number[],
- completeDate?: number[],
- type: string,
- status: string,
- releasedBy: string,
- items?: PickOrderItemInfo[] | null,
- }
-
- export const PreloadPickOrder = () => {
- fetchPickOrders()
- }
-
- export const fetchPickOrders = cache(async () => {
- return serverFetchJson<PickOrderResult[]>(`${BASE_API_URL}/pickOrder/list`, {
- next: {
- tags: ["pickOrders"]
- }
- })
- })
|