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

@@ -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]) {