fix: rimraf usage in user image delete

https://github.com/isaacs/rimraf/issues/275#issuecomment-1562402287
This commit is contained in:
Barış Soner Uşaklı
2023-05-25 09:12:02 -04:00
parent 24ebb1536b
commit 3256fb30e7

View File

@@ -208,9 +208,6 @@ module.exports = function (User) {
async function deleteImages(uid) {
const folder = path.join(nconf.get('upload_path'), 'profile');
await Promise.all([
rimraf(path.join(folder, `${uid}-profilecover*`), { glob: true }),
rimraf(path.join(folder, `${uid}-profileavatar*`), { glob: true }),
]);
await rimraf(`${uid}-profile{avatar,cover}*`, { glob: { cwd: folder } });
}
};