etapi fix misleading error message

This commit is contained in:
zadam 2022-07-10 22:09:13 +02:00
parent 0c4e5d2a19
commit 5cbcf6e6be
2 changed files with 1 additions and 3 deletions

View file

@ -2,8 +2,6 @@ const becca = require("../becca/becca");
const eu = require("./etapi_utils");
const mappers = require("./mappers");
const Branch = require("../becca/entities/branch");
const noteService = require("../services/notes");
const TaskContext = require("../services/task_context");
const entityChangesService = require("../services/entity_changes");
const v = require("./validators");

View file

@ -106,7 +106,7 @@ function getAndCheckAttribute(attributeId) {
function validateAndPatch(target, source, allowedProperties) {
for (const key of Object.keys(source)) {
if (!(key in allowedProperties)) {
throw new EtapiError(400, "PROPERTY_NOT_ALLOWED", `Property '${key}' is not allowed for PATCH.`);
throw new EtapiError(400, "PROPERTY_NOT_ALLOWED", `Property '${key}' is not allowed for this method.`);
}
else {
for (const validator of allowedProperties[key]) {