From 1c4f919e892a8136bca5f8df4bd81bb377b7ceda Mon Sep 17 00:00:00 2001 From: Juan Ferrer Toribio Date: Mon, 17 Apr 2023 22:24:19 +0200 Subject: [PATCH] refs #5553 Don't save image extension --- back/models/image.js | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/back/models/image.js b/back/models/image.js index a7ad69482..e13f9e100 100644 --- a/back/models/image.js +++ b/back/models/image.js @@ -30,13 +30,14 @@ module.exports = Self => { ); // Insert image row + const imageName = path.parse(fileName).name; await models.Image.upsertWithWhere( { - name: fileName, + name: imageName, collectionFk: collectionName }, { - name: fileName, + name: imageName, collectionFk: collectionName, updated: Date.vnNow() / 1000, } @@ -50,7 +51,7 @@ module.exports = Self => { if (entity) { await entity.updateAttribute( collection.property, - fileName + imageName ); }