({ threadId }: MessageUpdateEvent)
| 8 | }; |
| 9 | |
| 10 | export async function eventMessageUpdated({ threadId }: MessageUpdateEvent) { |
| 11 | const promises: Promise<any>[] = []; |
| 12 | |
| 13 | if (threadId) { |
| 14 | const account = await AccountsService.getAccountByThreadId(threadId); |
| 15 | if (!!account?.searchSettings) { |
| 16 | promises.push( |
| 17 | createTypesenseOnMessageUpdate({ |
| 18 | threadId, |
| 19 | accountId: account.id, |
| 20 | }) |
| 21 | ); |
| 22 | } |
| 23 | } |
| 24 | |
| 25 | await Promise.allSettled(promises); |
| 26 | } |
no test coverage detected