FPSMS-frontend
Nevar pievienot vairāk kā 25 tēmas Tēmai ir jāsākas ar burtu vai ciparu, tā var saturēt domu zīmes ('-') un var būt līdz 35 simboliem gara.
 
 

31 rinda
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. });