import {GET} from "@/shared/api/apiClient";
import {USEFUL_INFORMATION} from "@/shared/constants/apiEndpoints";
import {GetUsefulResponse} from "@/shared/types/useful";

export const getUseful = async (): Promise<GetUsefulResponse> => {
  const {data} = await GET<GetUsefulResponse>(USEFUL_INFORMATION)
  return data
}

export const getUsefulById = async (id: number): Promise<any> => {
  const {data} = await GET(`${USEFUL_INFORMATION}/${id}`)
  return data
}

export const getUsefulItems = async (useful_id: number, items_id:number): Promise<any> => {
  const {data} = await GET(`${USEFUL_INFORMATION}/${useful_id}/items/${items_id}`)
  return data
}