mirror of
https://github.com/NodeBB/NodeBB.git
synced 2025-11-06 14:05:46 +01:00
fix: #7853, dissociation on post purge
This commit is contained in:
@@ -108,6 +108,11 @@ module.exports = function (Posts) {
|
||||
]);
|
||||
};
|
||||
|
||||
Posts.uploads.dissociateAll = async (pid) => {
|
||||
const current = await Posts.uploads.list(pid);
|
||||
await Promise.all(current.map(async path => await Posts.uploads.dissociate(pid, path)));
|
||||
};
|
||||
|
||||
Posts.uploads.saveSize = async (filePaths) => {
|
||||
await Promise.all(filePaths.map(async function (fileName) {
|
||||
try {
|
||||
|
||||
Reference in New Issue
Block a user