mirror of
https://framagit.org/les/gancio.git
synced 2025-02-01 00:52:01 +01:00
[fix] remove media files on event removal
This commit is contained in:
parent
ecd3f1bd05
commit
5cdb792fcb
1 changed files with 2 additions and 4 deletions
|
@ -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)
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue