FPSMS-frontend
您最多选择25个主题 主题必须以字母或数字开头,可以包含连字符 (-),并且长度不得超过35个字符
 
 

31 行
732 B

  1. import { serverFetchJson } from "@/app/utils/fetchUtil";
  2. import { BASE_API_URL } from "@/config/api";
  3. import { cache } from "react";
  4. import "server-only";
  5. export interface InventoryResult {
  6. id: number;
  7. itemCode: string;
  8. itemName: string;
  9. itemType: string;
  10. availableQty: number;
  11. uomCode: string;
  12. uomUdfudesc: string;
  13. // germPerSmallestUnit: number;
  14. // qtyPerSmallestUnit: number;
  15. // smallestUnit: string;
  16. price: number;
  17. currencyName: string;
  18. status: string;
  19. }
  20. export const preloadInventory = () => {
  21. fetchInventories();
  22. };
  23. export const fetchInventories = cache(async () => {
  24. return serverFetchJson<InventoryResult[]>(`${BASE_API_URL}/inventory/list`, {
  25. next: { tags: ["inventories"] },
  26. });
  27. });