mirror of
https://github.com/NodeBB/NodeBB.git
synced 2025-11-11 00:15:46 +01:00
feat: server-side routes for handling multiple topic thumbnails
closes #8994, requires 'topic-thumb-refactor' branch of composer-default
This commit is contained in:
@@ -36,6 +36,9 @@ postsAPI.edit = async function (caller, data) {
|
||||
data.req = apiHelpers.buildReqObject(caller);
|
||||
|
||||
const editResult = await posts.edit(data);
|
||||
if (editResult.topic.isMainPost) {
|
||||
await topics.thumbs.commit(data.uuid, editResult.topic.tid);
|
||||
}
|
||||
if (editResult.topic.renamed) {
|
||||
await events.log({
|
||||
type: 'topic-rename',
|
||||
|
||||
@@ -34,6 +34,7 @@ topicsAPI.create = async function (caller, data) {
|
||||
}
|
||||
|
||||
const result = await topics.post(payload);
|
||||
await topics.thumbs.commit(data.uuid, result.topicData.tid);
|
||||
|
||||
socketHelpers.emitToUids('event:new_post', { posts: [result.postData] }, [caller.uid]);
|
||||
socketHelpers.emitToUids('event:new_topic', result.topicData, [caller.uid]);
|
||||
|
||||
Reference in New Issue
Block a user