FPSMS-frontend
25'ten fazla konu seçemezsiniz Konular bir harf veya rakamla başlamalı, kısa çizgiler ('-') içerebilir ve en fazla 35 karakter uzunluğunda olabilir.
 
 

43 satır
1.0 KiB

  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. stockTakeSectionDescription?: string;
  18. }
  19. export interface WarehouseCombo {
  20. id: number;
  21. value: number;
  22. label: string;
  23. }
  24. export const fetchWarehouseList = cache(async () => {
  25. return serverFetchJson<WarehouseResult[]>(`${BASE_API_URL}/warehouse`, {
  26. next: { tags: ["warehouse"] },
  27. });
  28. });
  29. export const fetchWarehouseCombo = cache(async () => {
  30. return serverFetchJson<WarehouseCombo[]>(`${BASE_API_URL}/warehouse/combo`, {
  31. next: { tags: ["warehouseCombo"] },
  32. });
  33. });
  34. export interface StockTakeSectionInfo {
  35. id: string;
  36. stockTakeSection: string;
  37. stockTakeSectionDescription: string | null;
  38. warehouseCount: number;
  39. }