mirror of
https://github.com/NodeBB/NodeBB.git
synced 2025-10-26 16:46:12 +01:00
fix: type error in attachment emptying method
This commit is contained in:
@@ -55,9 +55,8 @@ Attachments.empty = async (pids) => {
|
|||||||
winston.verbose(`[posts/attachments] Emptying attachments for ids ${pids.join(', ')}.`);
|
winston.verbose(`[posts/attachments] Emptying attachments for ids ${pids.join(', ')}.`);
|
||||||
const zsets = pids.map(pid => `post:${pid}:attachments`);
|
const zsets = pids.map(pid => `post:${pid}:attachments`);
|
||||||
const hashes = await db.getSortedSetsMembers(zsets);
|
const hashes = await db.getSortedSetsMembers(zsets);
|
||||||
const keys = hashes
|
let keys = hashes.reduce((memo, hashes) => new Set([...memo, ...hashes]), new Set());
|
||||||
.reduce((memo, hashes) => new Set([...memo, ...hashes]), new Set())
|
keys = Array.from(keys).map(hash => `attachment:${hash}`);
|
||||||
.map(hash => `attachment:${hash}`);
|
|
||||||
|
|
||||||
await db.deleteAll(keys.concat(zsets));
|
await db.deleteAll(keys.concat(zsets));
|
||||||
};
|
};
|
||||||
|
|||||||
Reference in New Issue
Block a user