source: frontend/src/services/doctorService.js@ d30d820

Last change on this file since d30d820 was 20468d3, checked in by MBK <marija.karapandzova@…>, 4 months ago

Add pages and routing for patients, doctors, departments and appointments with api services

  • Property mode set to 100644
File size: 725 bytes
Line 
1import apiClient from './api';
2
3const ENDPOINT = '/doctors';
4
5export const doctorService = {
6 getAllDoctors: () => apiClient.get(ENDPOINT),
7
8 getDoctorById: (id) => apiClient.get(`${ENDPOINT}/${id}`),
9
10 getDoctorByEmail: (email) => apiClient.get(`${ENDPOINT}/email/${email}`),
11
12 getDoctorsByDepartment: (departmentId) => apiClient.get(`${ENDPOINT}/department/${departmentId}`),
13
14 getDoctorsBySpecialization: (specializationId) => apiClient.get(`${ENDPOINT}/specialization/${specializationId}`),
15
16 getDoctorsByLevel: (levelId) => apiClient.get(`${ENDPOINT}/level/${levelId}`),
17
18 createDoctor: (doctor) => apiClient.post(ENDPOINT, doctor),
19
20 updateDoctor: (id, doctor) => apiClient.put(`${ENDPOINT}/${id}`, doctor),
21};
Note: See TracBrowser for help on using the repository browser.