78 lines
3.3 KiB
JavaScript
78 lines
3.3 KiB
JavaScript
"use strict";
|
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
exports.ApprovalRouteApi = void 0;
|
|
var tslib_1 = require("tslib");
|
|
// Тонкий 1:1 фасад над контроллерами бэкенда:
|
|
// backend/src/Tnsu.ApprovalRoute.Api/Controllers/{RequestTypes,TemplateRoutes,TemplateRouteSteps}Controller.cs
|
|
var ApprovalRouteApi = /** @class */ (function () {
|
|
function ApprovalRouteApi(http) {
|
|
var _this = this;
|
|
this.http = http;
|
|
this.requestTypes = {
|
|
list: function () {
|
|
return _this.http.get('/api/request-types');
|
|
},
|
|
get: function (id) {
|
|
return _this.http.get("/api/request-types/".concat(id));
|
|
},
|
|
create: function (body) {
|
|
return _this.http.post('/api/request-types', body);
|
|
},
|
|
update: function (id, body) {
|
|
return _this.http.put("/api/request-types/".concat(id), body);
|
|
},
|
|
patch: function (id, body) {
|
|
return _this.http.patch("/api/request-types/".concat(id), body);
|
|
},
|
|
remove: function (id) {
|
|
return _this.http.delete("/api/request-types/".concat(id));
|
|
}
|
|
};
|
|
this.templateRoutes = {
|
|
list: function (requestTypeId) {
|
|
return _this.http.get('/api/template-routes', { requestTypeId: requestTypeId });
|
|
},
|
|
get: function (id) {
|
|
return _this.http.get("/api/template-routes/".concat(id));
|
|
},
|
|
create: function (body) {
|
|
return _this.http.post('/api/template-routes', body);
|
|
},
|
|
update: function (id, body) {
|
|
return _this.http.put("/api/template-routes/".concat(id), body);
|
|
},
|
|
patch: function (id, body) {
|
|
return _this.http.patch("/api/template-routes/".concat(id), body);
|
|
},
|
|
remove: function (id) {
|
|
return _this.http.delete("/api/template-routes/".concat(id));
|
|
},
|
|
resolve: function (query) {
|
|
return _this.http.get('/api/template-routes/resolve', tslib_1.__assign({}, query));
|
|
}
|
|
};
|
|
this.templateRouteSteps = {
|
|
list: function (routeId) {
|
|
return _this.http.get("/api/template-routes/".concat(routeId, "/steps"));
|
|
},
|
|
get: function (routeId, id) {
|
|
return _this.http.get("/api/template-routes/".concat(routeId, "/steps/").concat(id));
|
|
},
|
|
create: function (routeId, body) {
|
|
return _this.http.post("/api/template-routes/".concat(routeId, "/steps"), body);
|
|
},
|
|
update: function (routeId, id, body) {
|
|
return _this.http.put("/api/template-routes/".concat(routeId, "/steps/").concat(id), body);
|
|
},
|
|
patch: function (routeId, id, body) {
|
|
return _this.http.patch("/api/template-routes/".concat(routeId, "/steps/").concat(id), body);
|
|
},
|
|
remove: function (routeId, id) {
|
|
return _this.http.delete("/api/template-routes/".concat(routeId, "/steps/").concat(id));
|
|
}
|
|
};
|
|
}
|
|
return ApprovalRouteApi;
|
|
}());
|
|
exports.ApprovalRouteApi = ApprovalRouteApi;
|
|
//# sourceMappingURL=api.js.map
|