mirror of
https://github.com/zadam/trilium.git
synced 2025-03-01 14:22:32 +01:00
etapi fix misleading error message
This commit is contained in:
parent
0c4e5d2a19
commit
5cbcf6e6be
@ -2,8 +2,6 @@ const becca = require("../becca/becca");
|
|||||||
const eu = require("./etapi_utils");
|
const eu = require("./etapi_utils");
|
||||||
const mappers = require("./mappers");
|
const mappers = require("./mappers");
|
||||||
const Branch = require("../becca/entities/branch");
|
const Branch = require("../becca/entities/branch");
|
||||||
const noteService = require("../services/notes");
|
|
||||||
const TaskContext = require("../services/task_context");
|
|
||||||
const entityChangesService = require("../services/entity_changes");
|
const entityChangesService = require("../services/entity_changes");
|
||||||
const v = require("./validators");
|
const v = require("./validators");
|
||||||
|
|
||||||
|
@ -106,7 +106,7 @@ function getAndCheckAttribute(attributeId) {
|
|||||||
function validateAndPatch(target, source, allowedProperties) {
|
function validateAndPatch(target, source, allowedProperties) {
|
||||||
for (const key of Object.keys(source)) {
|
for (const key of Object.keys(source)) {
|
||||||
if (!(key in allowedProperties)) {
|
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 {
|
else {
|
||||||
for (const validator of allowedProperties[key]) {
|
for (const validator of allowedProperties[key]) {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user