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

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

Add pages and routing for medical recors, medical reports and referrals with api services

  • Property mode set to 100644
File size: 866 bytes
Line 
1import apiClient from './api';
2
3const ENDPOINT = '/referrals';
4
5export const referralService = {
6 createReferral: (referralData) => {
7 return apiClient.post(ENDPOINT, {
8 medicalRecordId: referralData.medicalRecordId,
9 fromDoctorId: referralData.fromDoctorId,
10 toDoctorId: referralData.toDoctorId,
11 reason: referralData.reason,
12 referralDate: referralData.referralDate,
13 appointmentDate: referralData.appointmentDate,
14 appointmentTime: referralData.appointmentTime,
15 });
16 },
17
18 getReferralById: (id) => apiClient.get(`${ENDPOINT}/${id}`),
19
20 getReferralsByFromDoctor: (doctorId) => apiClient.get(`${ENDPOINT}/from-doctor/${doctorId}`),
21
22 getReferralsByToDoctor: (doctorId) => apiClient.get(`${ENDPOINT}/to-doctor/${doctorId}`),
23
24 getReferralsByPatient: (patientId) => apiClient.get(`${ENDPOINT}/patient/${patientId}`),
25};
Note: See TracBrowser for help on using the repository browser.