FPSMS-frontend
Nelze vybrat více než 25 témat Téma musí začínat písmenem nebo číslem, může obsahovat pomlčky („-“) a může být dlouhé až 35 znaků.
 
 

24 řádky
643 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 BomWeightingScoreResult {
  6. id: number;
  7. code: string;
  8. name: string;
  9. range: number;
  10. weighting: number | string | { value?: number; [key: string]: any };
  11. remarks?: string;
  12. }
  13. export const preloadBomWeightingScores = () => {
  14. fetchBomWeightingScores();
  15. };
  16. export const fetchBomWeightingScores = cache(async () => {
  17. return serverFetchJson<BomWeightingScoreResult[]>(`${BASE_API_URL}/bomWeightingScores`, {
  18. next: { tags: ["bomWeightingScores"] },
  19. });
  20. });