FPSMS-frontend
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 

40 line
773 B

  1. // import { serverFetchJson } from "@/app/utils/fetchUtil";
  2. // import { BASE_API_URL } from "@/config/api";
  3. import { serverFetchJson } from "../../utils/fetchUtil";
  4. import { BASE_API_URL } from "../../../config/api";
  5. import { cache } from "react";
  6. export interface DoResult {
  7. id: number;
  8. code: string;
  9. orderDate: string;
  10. estimatedArrivalDate: string;
  11. status: string;
  12. shopName: string;
  13. }
  14. export interface DoDetailLine {
  15. id: number;
  16. itemNo: string;
  17. qty: number;
  18. price: number;
  19. status: string;
  20. itemName?: string;
  21. uomCode?: string;
  22. }
  23. export const preloadDo = () => {
  24. fetchDoList();
  25. };
  26. export const fetchDoList = cache(async () => {
  27. return serverFetchJson<DoResult[]>(`${BASE_API_URL}/do/list`, {
  28. next: { tags: ["doList"] },
  29. });
  30. });