From 821cbf7aa48032e1c062f0254289d1be1db79ee2 Mon Sep 17 00:00:00 2001 From: philc Date: Mon, 16 Dec 2024 09:57:24 +0100 Subject: [PATCH] save relative path for image instead apbsolute --- apxtri/models/Checkjson.js | 2 +- apxtri/models/Odmdb.js | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/apxtri/models/Checkjson.js b/apxtri/models/Checkjson.js index 4dcc3f9..835179f 100755 --- a/apxtri/models/Checkjson.js +++ b/apxtri/models/Checkjson.js @@ -97,7 +97,7 @@ Checkjson.schema.properties.format = { /^(([^<>()[\]\\.,;:\s@\"]+(\.[^<>()[\]\\.,;:\s@\"]+)*)|(\".+\"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$/, "idn-email": / /, uuid: /^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/, - uri: / /, + uri: /^((https?|ftp):\/\/)?([a-zA-Z0-9.-]+)(:[0-9]{1,5})?(\/[^\s]*)?$/, url: /^(?:(?:https?|ftp):\/\/)(?:\w+(?::\w+)?@)?(?:(?:[a-z0-9-\.]+\.[a-z]{2,})(?:[-a-z0-9+\._\%\!\\[\]\(\)\,\*\?\&\=\:]*){1,})|(?:(?:25[0-5]|2[0-4][0-9]|[0-1]?[0-9][0-9]?)\.(?:25[0-5]|2[0-4][0-9]|[0-1]?[0-9][0-9]?)\.(?:25[0-5]|2[0-4][0-9]|[0-1]?[0-9][0-9]?)\.(?:25[0-5]|2[0-4][0-9]|[0-1]?[0-9][0-9]?))(?:[:\/#][^#]*)?$/, "uri-reference": / /, iri: / /, diff --git a/apxtri/models/Odmdb.js b/apxtri/models/Odmdb.js index 679503b..a6d8d26 100644 --- a/apxtri/models/Odmdb.js +++ b/apxtri/models/Odmdb.js @@ -709,7 +709,7 @@ Odmdb.cud = (objectPathname, crud, itm, role, runindex = true) => { ); } else { const objectname = objectPathname.split("/").slice(-1)[0]; - itmtostore[newk] = `/objectimg/${objectname}${filenameimg}`; + itmtostore[newk] = `objectimg/${objectname}${filenameimg}`; //const webp = require("webp-converter"); //const buf = Buffer.from(itmtostore[k], 'base64'); //const imgwebp = await webp.bufferToWebp(buf);