Commit 5cdb792f authored by les's avatar les
Browse files

[fix] remove media files on event removal

parent ecd3f1bd
...@@ -51,10 +51,8 @@ const userController = { ...@@ -51,10 +51,8 @@ const userController = {
const old_path = path.join(config.upload_path, event.image_path) const old_path = path.join(config.upload_path, event.image_path)
const old_thumb_path = path.join(config.upload_path, 'thumb', event.image_path) const old_thumb_path = path.join(config.upload_path, 'thumb', event.image_path)
try { try {
console.error('media files not removed') fs.unlinkSync(old_thumb_path)
// TOFIX fs.unlinkSync(old_path)
await fs.unlink(old_thumb_path)
await fs.unlink(old_path)
} catch (e) { } catch (e) {
debug(e) debug(e)
} }
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment