UNPKG

@starsched/sdk

Version:

ABA clinic control and management service API SDK

25 lines (24 loc) 754 B
export class Appointments { httpClient; constructor(httpClient) { this.httpClient = httpClient; } async list(input, options) { const { company_id, patient_id, ...inputQueryParams } = input; const queryParams = {}; if (typeof inputQueryParams.month) { queryParams.month = inputQueryParams.month.toJSON(); } const response = await this.httpClient.get(`/v1/companies/${company_id}/patients/${patient_id}/appointments`, { queryParams, ...options }); if (!response.ok) { return { data: null, error: response.body }; } return { data: response.body, error: null }; } }