mirror of
https://github.com/zadam/trilium.git
synced 2025-02-23 22:44:44 +08:00
etapi fix misleading error message
This commit is contained in:
parent
0c4e5d2a19
commit
5cbcf6e6be
2 changed files with 1 additions and 3 deletions
|
@ -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");
|
||||
|
||||
|
|
|
@ -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]) {
|
||||
|
|
Loading…
Reference in a new issue