source: frontend/src/api/consultationSlot.ts@ 700e2f9

main
Last change on this file since 700e2f9 was 700e2f9, checked in by 186079 <matej.milevski@…>, 5 days ago

Init

  • Property mode set to 100644
File size: 711 bytes
RevLine 
[700e2f9]1import { apiClient } from "@/api/client";
2
3export interface ConsultationSlot {
4 consultationSlots: string[]; // ISO date strings
5}
6
7export 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.