| 549 | }; |
| 550 | |
| 551 | const getInfiniteChatsQueryString = ( |
| 552 | filters: InfiniteChatsFilters | undefined, |
| 553 | ): string | undefined => { |
| 554 | const qParts: string[] = []; |
| 555 | if (filters?.archived !== undefined) { |
| 556 | qParts.push(`archived:${filters.archived}`); |
| 557 | } |
| 558 | if (filters?.prStatuses?.length) { |
| 559 | qParts.push(`pr_status:${filters.prStatuses.join(",")}`); |
| 560 | } |
| 561 | if (filters?.chatStatus) { |
| 562 | qParts.push(`has_unread:${filters.chatStatus === "unread"}`); |
| 563 | } |
| 564 | return qParts.length > 0 ? qParts.join(" ") : undefined; |
| 565 | }; |
| 566 | |
| 567 | export const infiniteChats = (filters?: InfiniteChatsFilters) => { |
| 568 | const limit = DEFAULT_CHAT_PAGE_LIMIT; |