From 8a2d880fba9301bca22fa0aeee2ee8715c1a1f86 Mon Sep 17 00:00:00 2001 From: Jakub Date: Fri, 14 Feb 2020 11:04:49 +0100 Subject: [PATCH] fix re-declaring content variable (#77) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Jakub SokoĊ‚owski --- back-end/models/dapps-images-model.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/back-end/models/dapps-images-model.js b/back-end/models/dapps-images-model.js index c164af3..f1d7345 100644 --- a/back-end/models/dapps-images-model.js +++ b/back-end/models/dapps-images-model.js @@ -22,8 +22,8 @@ DAppsImageSchema.pre('save', async function () { this.set({ content, hash }); }); -DAppsImageSchema.statics.findByContent = async function (content) { - const content = content.split('base64,')[1]; +DAppsImageSchema.statics.findByContent = async function (input) { + const content = input.split('base64,')[1]; const data = Buffer.from(content, 'base64'); const hash = await IPFSService.generateContentHash(data);