import api from './api';
import { Pharmacy } from '../types';

export async function getPharmacies(): Promise<Pharmacy[]> {
  const response = await api.get('/pharmacies');
  return response.data;
}

export async function getPharmacy(id: number): Promise<Pharmacy> {
  const response = await api.get(`/pharmacies/${id}`);
  return response.data;
}

export async function getPharmacyMedicines(id: number): Promise<any[]> {
  const response = await api.get(`/pharmacies/${id}/medicines`);
  return response.data;
}
