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.
 
 

37 lines
847 B

  1. import { cache } from "react";
  2. import "server-only";
  3. import { serverFetchJson } from "@/app/utils/fetchUtil";
  4. import { BASE_API_URL } from "@/config/api";
  5. export interface WarehouseResult {
  6. action: any;
  7. id: number;
  8. code: string;
  9. name: string;
  10. description: string;
  11. store_id?: string;
  12. warehouse?: string;
  13. area?: string;
  14. slot?: string;
  15. order?: string;
  16. stockTakeSection?: string;
  17. }
  18. export interface WarehouseCombo {
  19. id: number;
  20. value: number;
  21. label: string;
  22. }
  23. export const fetchWarehouseList = cache(async () => {
  24. return serverFetchJson<WarehouseResult[]>(`${BASE_API_URL}/warehouse`, {
  25. next: { tags: ["warehouse"] },
  26. });
  27. });
  28. export const fetchWarehouseCombo = cache(async () => {
  29. return serverFetchJson<WarehouseCombo[]>(`${BASE_API_URL}/warehouse/combo`, {
  30. next: { tags: ["warehouseCombo"] },
  31. });
  32. });