mirror of
https://github.com/NodeBB/NodeBB.git
synced 2026-02-26 08:31:22 +01:00
fix: rimraf usage in user image delete
https://github.com/isaacs/rimraf/issues/275#issuecomment-1562402287
This commit is contained in:
@@ -208,9 +208,6 @@ module.exports = function (User) {
|
|||||||
|
|
||||||
async function deleteImages(uid) {
|
async function deleteImages(uid) {
|
||||||
const folder = path.join(nconf.get('upload_path'), 'profile');
|
const folder = path.join(nconf.get('upload_path'), 'profile');
|
||||||
await Promise.all([
|
await rimraf(`${uid}-profile{avatar,cover}*`, { glob: { cwd: folder } });
|
||||||
rimraf(path.join(folder, `${uid}-profilecover*`), { glob: true }),
|
|
||||||
rimraf(path.join(folder, `${uid}-profileavatar*`), { glob: true }),
|
|
||||||
]);
|
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|||||||
Reference in New Issue
Block a user