source: frontend/src/services/patientService.js@ 84249b1

Last change on this file since 84249b1 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: 508 bytes
Line 
1import apiClient from './api';
2
3const ENDPOINT = '/patients';
4
5export const patientService = {
6 getAllPatients: () => apiClient.get(ENDPOINT),
7
8 getPatientById: (id) => apiClient.get(`${ENDPOINT}/${id}`),
9
10 getPatientByEmbg: (embg) => apiClient.get(`${ENDPOINT}/embg/${embg}`),
11
12 getPatientByEmail: (email) => apiClient.get(`${ENDPOINT}/email/${email}`),
13
14 createPatient: (patient) => apiClient.post(ENDPOINT, patient),
15
16 updatePatient: (id, patient) => apiClient.put(`${ENDPOINT}/${id}`, patient),
17};
Note: See TracBrowser for help on using the repository browser.