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ů.
 
 

31 řádky
870 B

  1. "use client";
  2. import axiosInstance from "@/app/(main)/axios/axiosInstance";
  3. import { NEXT_PUBLIC_API_URL } from "@/config/api";
  4. import { BomWeightingScoreResult } from "./index";
  5. export interface UpdateBomWeightingScoreInputs {
  6. id: number;
  7. name: string;
  8. range: number;
  9. weighting: number;
  10. remarks?: string;
  11. }
  12. export const fetchBomWeightingScoresClient = async (): Promise<BomWeightingScoreResult[]> => {
  13. const response = await axiosInstance.get<BomWeightingScoreResult[]>(
  14. `${NEXT_PUBLIC_API_URL}/bomWeightingScores`
  15. );
  16. return response.data;
  17. };
  18. export const updateBomWeightingScoreClient = async (
  19. data: UpdateBomWeightingScoreInputs
  20. ): Promise<BomWeightingScoreResult> => {
  21. const response = await axiosInstance.put<BomWeightingScoreResult>(
  22. `${NEXT_PUBLIC_API_URL}/bomWeightingScores/${data.id}`,
  23. data
  24. );
  25. return response.data;
  26. };