refactor: add thumbsOnly option to thumbs retrieval method so that embeds/attachments don't show up in composer thumbnail modal

This commit is contained in:
Julian Lam
2024-12-17 11:14:29 -05:00
parent f4835695de
commit 51fd65abc8
5 changed files with 48 additions and 27 deletions

View File

@@ -215,7 +215,7 @@ topicsAPI.deleteTags = async (caller, { tid }) => {
await topics.deleteTopicTags(tid);
};
topicsAPI.getThumbs = async (caller, { tid }) => {
topicsAPI.getThumbs = async (caller, { tid, thumbsOnly }) => {
if (isFinite(tid)) { // post_uuids can be passed in occasionally, in that case no checks are necessary
const [exists, canRead] = await Promise.all([
topics.exists(tid),
@@ -229,7 +229,7 @@ topicsAPI.getThumbs = async (caller, { tid }) => {
}
}
return await topics.thumbs.get(tid);
return await topics.thumbs.get(tid, { thumbsOnly });
};
// topicsAPI.addThumb