@starsched/sdk
Version:
ABA clinic control and management service API SDK
51 lines (50 loc) • 1.37 kB
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
exports.Companies = void 0;
class Companies {
httpClient;
constructor(httpClient) {
this.httpClient = httpClient;
}
async getMyCompanies(options) {
const response = await this.httpClient.get('/v1/companies/mine', options);
if (!response.ok) {
return {
data: null,
error: response.body
};
}
return {
data: response.body,
error: null
};
}
async create(input, options) {
const response = await this.httpClient.post('/v1/companies', input, options);
if (!response.ok) {
return {
data: null,
error: response.body
};
}
return {
data: response.body,
error: null
};
}
async update(input, options) {
const { company_id, ...inputBody } = input;
const response = await this.httpClient.put(`/v1/companies/${company_id}`, inputBody, options);
if (!response.ok) {
return {
data: null,
error: response.body
};
}
return {
data: response.body,
error: null
};
}
}
exports.Companies = Companies;