mirror of
https://github.com/NodeBB/NodeBB.git
synced 2025-10-27 09:06:15 +01:00
fix: missing awaits, possible test fix
This commit is contained in:
@@ -89,7 +89,7 @@ Thumbs.associate = async function ({ id, path, score }) {
|
|||||||
// Associate thumbnails with the main pid (only on local upload)
|
// Associate thumbnails with the main pid (only on local upload)
|
||||||
if (!isDraft && isLocal) {
|
if (!isDraft && isLocal) {
|
||||||
const mainPid = (await topics.getMainPids([id]))[0];
|
const mainPid = (await topics.getMainPids([id]))[0];
|
||||||
posts.uploads.associate(mainPid, path.replace('/files/', ''));
|
await posts.uploads.associate(mainPid, path.replace('/files/', ''));
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
@@ -131,7 +131,7 @@ Thumbs.delete = async function (id, relativePath) {
|
|||||||
await db.deleteObjectField(`topic:${id}`, 'numThumbs');
|
await db.deleteObjectField(`topic:${id}`, 'numThumbs');
|
||||||
}
|
}
|
||||||
const mainPid = (await topics.getMainPids([id]))[0];
|
const mainPid = (await topics.getMainPids([id]))[0];
|
||||||
posts.uploads.dissociate(mainPid, relativePath.replace('/files/', ''));
|
await posts.uploads.dissociate(mainPid, relativePath.replace('/files/', ''));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|||||||
Reference in New Issue
Block a user