@capawesome/cli
Version:
The Capawesome Cloud Command Line Interface (CLI) to manage Live Updates and more.
27 lines (26 loc) • 920 B
JavaScript
import httpClient from '../utils/http-client.js';
import authorizationService from '../services/authorization-service.js';
class OrganizationsServiceImpl {
httpClient;
constructor(httpClient) {
this.httpClient = httpClient;
}
async create(dto) {
const response = await this.httpClient.post('/v1/organizations', dto, {
headers: {
Authorization: `Bearer ${authorizationService.getCurrentAuthorizationToken()}`,
},
});
return response.data;
}
async findAll() {
const response = await this.httpClient.get(`/v1/organizations`, {
headers: {
Authorization: `Bearer ${authorizationService.getCurrentAuthorizationToken()}`,
},
});
return response.data;
}
}
const organizationsService = new OrganizationsServiceImpl(httpClient);
export default organizationsService;