|
Last change
on this file since 20468d3 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:
500 bytes
|
| Line | |
|---|
| 1 | import apiClient from './api';
|
|---|
| 2 |
|
|---|
| 3 | const ENDPOINT = '/departments';
|
|---|
| 4 |
|
|---|
| 5 | export const departmentService = {
|
|---|
| 6 | getAllDepartments: () => apiClient.get(ENDPOINT),
|
|---|
| 7 |
|
|---|
| 8 | getDepartmentById: (id) => apiClient.get(`${ENDPOINT}/${id}`),
|
|---|
| 9 |
|
|---|
| 10 | getDoctorsByDepartment: (departmentId) => apiClient.get(`${ENDPOINT}/${departmentId}/doctors`),
|
|---|
| 11 |
|
|---|
| 12 | createDepartment: (departmentData) => apiClient.post(ENDPOINT, departmentData),
|
|---|
| 13 |
|
|---|
| 14 | updateDepartment: (id, departmentData) => apiClient.put(`${ENDPOINT}/${id}`, departmentData),
|
|---|
| 15 | }; |
|---|
Note:
See
TracBrowser
for help on using the repository browser.