"use client"; import axiosInstance from "@/app/(main)/axios/axiosInstance"; import { NEXT_PUBLIC_API_URL } from "@/config/api"; import { BomWeightingScoreResult } from "./index"; export interface UpdateBomWeightingScoreInputs { id: number; name: string; range: number; weighting: number; remarks?: string; } export const fetchBomWeightingScoresClient = async (): Promise => { const response = await axiosInstance.get( `${NEXT_PUBLIC_API_URL}/bomWeightingScores` ); return response.data; }; export const updateBomWeightingScoreClient = async ( data: UpdateBomWeightingScoreInputs ): Promise => { const response = await axiosInstance.put( `${NEXT_PUBLIC_API_URL}/bomWeightingScores/${data.id}`, data ); return response.data; };