FPSMS-frontend
Nie możesz wybrać więcej, niż 25 tematów Tematy muszą się zaczynać od litery lub cyfry, mogą zawierać myślniki ('-') i mogą mieć do 35 znaków.
 
 
 

35 wiersze
858 B

  1. import "server-only";
  2. // import { serverFetchJson } from "@/app/utils/fetchUtil";
  3. // import { BASE_API_URL } from "@/config/api";
  4. import { serverFetchJson } from "../../utils/fetchUtil";
  5. import { BASE_API_URL } from "../../../config/api";
  6. import { cache } from "react";
  7. interface PickOrderItemInfo {
  8. name: string,
  9. type: string,
  10. }
  11. export interface PickOrderResult{
  12. id: number,
  13. code: string,
  14. consoCode?: string,
  15. targetDate: number[],
  16. completeDate?: number[],
  17. type: string,
  18. status: string,
  19. releasedBy: string,
  20. items?: PickOrderItemInfo[] | null,
  21. }
  22. export const PreloadPickOrder = () => {
  23. fetchPickOrders()
  24. }
  25. export const fetchPickOrders = cache(async () => {
  26. return serverFetchJson<PickOrderResult[]>(`${BASE_API_URL}/pickOrder/list`, {
  27. next: {
  28. tags: ["pickOrders"]
  29. }
  30. })
  31. })