UNPKG

@eleva-io/erp-sdk

Version:

SDK oficial para el ERP de Eleva

39 lines 1.25 kB
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.CommonAreasAPI = void 0; const crud_1 = require("../../../../utils/crud"); class CommonAreasAPI { _httpClient; _baseUrl; _commonAreaId; _crud; constructor(_httpClient, _baseUrl, _commonAreaId) { this._httpClient = _httpClient; this._baseUrl = _baseUrl; this._commonAreaId = _commonAreaId; this._crud = new crud_1.CRUD(_httpClient, { basePath: _baseUrl, id: _commonAreaId, }); } async find(query) { return this._crud.find(query); } async create(data) { return this._httpClient.form(this._baseUrl, { ...data }); } async update(id, data) { const { reserve, routeTracking, ...rest } = data; const request = { ...rest, ...(reserve ? { reserve: JSON.stringify(reserve) } : {}), ...(routeTracking ? { routeTracking: JSON.stringify(routeTracking) } : {}), }; return this._httpClient.form(`${this._baseUrl}/${id}`, request, 'PUT'); } async delete(id) { return this._crud.delete(id); } } exports.CommonAreasAPI = CommonAreasAPI; //# sourceMappingURL=common_area.js.map