(id: string)
| 36 | } |
| 37 | |
| 38 | function findConversation(id: string): Conversation { |
| 39 | const store = getStore(); |
| 40 | const conv = store.getState().conversations.find((c) => c.id === id); |
| 41 | if (!conv) throw new ApiError(404, `Conversation ${id} not found`, "not_found"); |
| 42 | return conv; |
| 43 | } |
| 44 | |
| 45 | export const conversationAPI: ConversationAPI = { |
| 46 | async list(opts) { |