92 lines
4.5 KiB
JavaScript
92 lines
4.5 KiB
JavaScript
"use strict";
|
|
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
|
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
};
|
|
var __metadata = (this && this.__metadata) || function (k, v) {
|
|
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
|
|
};
|
|
var __param = (this && this.__param) || function (paramIndex, decorator) {
|
|
return function (target, key) { decorator(target, key, paramIndex); }
|
|
};
|
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
exports.CustomFieldsController = void 0;
|
|
const common_1 = require("@nestjs/common");
|
|
const custom_fields_service_1 = require("./custom-fields.service");
|
|
const custom_field_dto_1 = require("../shared/dto/custom-field.dto");
|
|
let CustomFieldsController = class CustomFieldsController {
|
|
customFieldsService;
|
|
constructor(customFieldsService) {
|
|
this.customFieldsService = customFieldsService;
|
|
}
|
|
createCustomFieldValue(createCustomFieldValueDto) {
|
|
return this.customFieldsService.createCustomFieldValue(createCustomFieldValueDto);
|
|
}
|
|
findCustomFieldValuesByEntity(entityType, entityId) {
|
|
return this.customFieldsService.findCustomFieldValuesByEntity(entityType, entityId);
|
|
}
|
|
findOneCustomFieldValue(id) {
|
|
return this.customFieldsService.findOneCustomFieldValue(id);
|
|
}
|
|
updateCustomFieldValue(id, updateCustomFieldValueDto) {
|
|
return this.customFieldsService.updateCustomFieldValue(id, updateCustomFieldValueDto);
|
|
}
|
|
removeCustomFieldValue(id) {
|
|
return this.customFieldsService.removeCustomFieldValue(id);
|
|
}
|
|
upsertCustomFieldValue(body) {
|
|
return this.customFieldsService.upsertCustomFieldValue(body.customFieldId, body.entityType, body.entityId, body.value);
|
|
}
|
|
};
|
|
exports.CustomFieldsController = CustomFieldsController;
|
|
__decorate([
|
|
(0, common_1.Post)('values'),
|
|
__param(0, (0, common_1.Body)()),
|
|
__metadata("design:type", Function),
|
|
__metadata("design:paramtypes", [custom_field_dto_1.CreateCustomFieldValueDto]),
|
|
__metadata("design:returntype", void 0)
|
|
], CustomFieldsController.prototype, "createCustomFieldValue", null);
|
|
__decorate([
|
|
(0, common_1.Get)('values/:entityType/:entityId'),
|
|
__param(0, (0, common_1.Param)('entityType')),
|
|
__param(1, (0, common_1.Param)('entityId')),
|
|
__metadata("design:type", Function),
|
|
__metadata("design:paramtypes", [String, String]),
|
|
__metadata("design:returntype", void 0)
|
|
], CustomFieldsController.prototype, "findCustomFieldValuesByEntity", null);
|
|
__decorate([
|
|
(0, common_1.Get)('values/:id'),
|
|
__param(0, (0, common_1.Param)('id')),
|
|
__metadata("design:type", Function),
|
|
__metadata("design:paramtypes", [String]),
|
|
__metadata("design:returntype", void 0)
|
|
], CustomFieldsController.prototype, "findOneCustomFieldValue", null);
|
|
__decorate([
|
|
(0, common_1.Patch)('values/:id'),
|
|
__param(0, (0, common_1.Param)('id')),
|
|
__param(1, (0, common_1.Body)()),
|
|
__metadata("design:type", Function),
|
|
__metadata("design:paramtypes", [String, custom_field_dto_1.UpdateCustomFieldValueDto]),
|
|
__metadata("design:returntype", void 0)
|
|
], CustomFieldsController.prototype, "updateCustomFieldValue", null);
|
|
__decorate([
|
|
(0, common_1.Delete)('values/:id'),
|
|
__param(0, (0, common_1.Param)('id')),
|
|
__metadata("design:type", Function),
|
|
__metadata("design:paramtypes", [String]),
|
|
__metadata("design:returntype", void 0)
|
|
], CustomFieldsController.prototype, "removeCustomFieldValue", null);
|
|
__decorate([
|
|
(0, common_1.Post)('values/upsert'),
|
|
__param(0, (0, common_1.Body)()),
|
|
__metadata("design:type", Function),
|
|
__metadata("design:paramtypes", [Object]),
|
|
__metadata("design:returntype", void 0)
|
|
], CustomFieldsController.prototype, "upsertCustomFieldValue", null);
|
|
exports.CustomFieldsController = CustomFieldsController = __decorate([
|
|
(0, common_1.Controller)('custom-fields'),
|
|
__metadata("design:paramtypes", [custom_fields_service_1.CustomFieldsService])
|
|
], CustomFieldsController);
|
|
//# sourceMappingURL=custom-fields.controller.js.map
|