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 ); }