Fix update lastPostAt (#6154)

This commit is contained in:
Elias Nahum
2022-04-11 03:10:20 -04:00
committed by GitHub
parent 4746ae4996
commit d9109691fd
2 changed files with 6 additions and 0 deletions

View File

@@ -358,6 +358,8 @@ export async function updateLastPostAt(serverUrl: string, channelId: string, las
} catch (error) {
return {error};
}
return {member};
}
return {member: undefined};

View File

@@ -131,6 +131,10 @@ export async function createPost(serverUrl: string, post: Partial<Post>, files:
posts: [created],
prepareRecordsOnly: true,
});
const {member} = await updateLastPostAt(serverUrl, created.channel_id, created.create_at, true);
if (member) {
models.push(member);
}
if (isCRTEnabled) {
const {models: threadModels} = await createThreadFromNewPost(serverUrl, created, true);
if (threadModels?.length) {