From 5cdb792fcb6ad480fd64c6edac92a2c8ed5e694f Mon Sep 17 00:00:00 2001 From: les Date: Thu, 24 Oct 2019 15:20:09 +0200 Subject: [PATCH] [fix] remove media files on event removal --- server/api/controller/user.js | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/server/api/controller/user.js b/server/api/controller/user.js index 275cf994..1d9cf4f7 100644 --- a/server/api/controller/user.js +++ b/server/api/controller/user.js @@ -51,10 +51,8 @@ const userController = { const old_path = path.join(config.upload_path, event.image_path) const old_thumb_path = path.join(config.upload_path, 'thumb', event.image_path) try { - console.error('media files not removed') - // TOFIX - await fs.unlink(old_thumb_path) - await fs.unlink(old_path) + fs.unlinkSync(old_thumb_path) + fs.unlinkSync(old_path) } catch (e) { debug(e) }