mirror of
https://github.com/zadam/trilium.git
synced 2026-05-06 15:06:04 +02:00
server-ts: Convert etapi/attachments
This commit is contained in:
@@ -120,7 +120,7 @@ function getAndCheckAttribute(attributeId: string) {
|
||||
}
|
||||
}
|
||||
|
||||
function validateAndPatch(target: Record<string, string>, source: Record<string, string>, allowedProperties: Record<string, ((value: string) => boolean)[]>) {
|
||||
function validateAndPatch(target: any, source: any, allowedProperties: ValidatorMap) {
|
||||
for (const key of Object.keys(source)) {
|
||||
if (!(key in allowedProperties)) {
|
||||
throw new EtapiError(400, "PROPERTY_NOT_ALLOWED", `Property '${key}' is not allowed for this method.`);
|
||||
|
||||
Reference in New Issue
Block a user