({
channelId,
messageId,
threadId,
imitationId,
thread,
}: ThreadUpdatedEvent)
| 17 | }; |
| 18 | |
| 19 | export async function eventThreadUpdated({ |
| 20 | channelId, |
| 21 | messageId, |
| 22 | threadId, |
| 23 | imitationId, |
| 24 | thread, |
| 25 | }: ThreadUpdatedEvent) { |
| 26 | const event = { |
| 27 | channelId, |
| 28 | messageId, |
| 29 | threadId, |
| 30 | imitationId, |
| 31 | isThread: true, |
| 32 | isReply: false, |
| 33 | thread, |
| 34 | }; |
| 35 | |
| 36 | const promises: Promise<any>[] = [ |
| 37 | createTwoWaySyncJob({ ...event, event: 'threadUpdated', id: messageId }), |
| 38 | ]; |
| 39 | |
| 40 | const account = await AccountsService.getAccountByThreadId(threadId); |
| 41 | if (!!account?.searchSettings && threadId) { |
| 42 | promises.push( |
| 43 | createTypesenseOnThreadUpdate({ |
| 44 | threadId, |
| 45 | accountId: account.id, |
| 46 | }) |
| 47 | ); |
| 48 | } |
| 49 | |
| 50 | await Promise.allSettled(promises); |
| 51 | } |
no test coverage detected