import { apiClient } from "@/api/client"; export interface Therapy { idTherapy: number; name: string; dose: string; expDate: string; consultationId: number; } export interface CreateTherapyRequest { name: string; dose: string; expDate: string; } export interface UpdateTherapyRequest { name?: string; dose?: string; expDate?: string; } export const therapyApi = { getTherapiesByConsultation: async ( consultationId: number, ): Promise => apiClient.get(`/therapies/consultation/${consultationId}`), createTherapy: async ( consultationId: number, data: CreateTherapyRequest, ): Promise => apiClient.post(`/therapies/consultation/${consultationId}`, data), updateTherapy: async ( therapyId: number, data: UpdateTherapyRequest, ): Promise => apiClient.put(`/therapies/${therapyId}`, data), deleteTherapy: async (therapyId: number): Promise => apiClient.delete(`/therapies/${therapyId}`), };