main
|
Last change
on this file was 700e2f9, checked in by 186079 <matej.milevski@…>, 5 days ago |
|
Init
|
-
Property mode
set to
100644
|
|
File size:
711 bytes
|
| Rev | Line | |
|---|
| [700e2f9] | 1 | import { apiClient } from "@/api/client";
|
|---|
| 2 |
|
|---|
| 3 | export interface ConsultationSlot {
|
|---|
| 4 | consultationSlots: string[]; // ISO date strings
|
|---|
| 5 | }
|
|---|
| 6 |
|
|---|
| 7 | export const consultationSlotApi = {
|
|---|
| 8 | getSlots: async (therapistId: number): Promise<ConsultationSlot> =>
|
|---|
| 9 | apiClient.get<ConsultationSlot>(`/consultation-slots/${therapistId}`),
|
|---|
| 10 |
|
|---|
| 11 | addSlot: async (
|
|---|
| 12 | therapistId: number,
|
|---|
| 13 | date: string,
|
|---|
| 14 | ): Promise<ConsultationSlot> =>
|
|---|
| 15 | apiClient.post<ConsultationSlot>(`/consultation-slots/${therapistId}`, {
|
|---|
| 16 | date,
|
|---|
| 17 | }),
|
|---|
| 18 |
|
|---|
| 19 | removeSlot: async (
|
|---|
| 20 | therapistId: number,
|
|---|
| 21 | date: string,
|
|---|
| 22 | ): Promise<ConsultationSlot> =>
|
|---|
| 23 | apiClient.delete<ConsultationSlot>(
|
|---|
| 24 | `/consultation-slots/${therapistId}/${date}`,
|
|---|
| 25 | ),
|
|---|
| 26 | };
|
|---|
Note:
See
TracBrowser
for help on using the repository browser.