feat(threads): add basic message thread API and web thread panel
All checks were successful
CI / test (push) Successful in 21s
All checks were successful
CI / test (push) Successful in 21s
This commit is contained in:
@@ -76,6 +76,13 @@ export async function searchMessages(query: string, chatId?: number): Promise<Me
|
||||
return data;
|
||||
}
|
||||
|
||||
export async function getMessageThread(messageId: number, limit = 100): Promise<Message[]> {
|
||||
const { data } = await http.get<Message[]>(`/messages/${messageId}/thread`, {
|
||||
params: { limit }
|
||||
});
|
||||
return data;
|
||||
}
|
||||
|
||||
export async function sendMessage(chatId: number, text: string, type: MessageType = "text"): Promise<Message> {
|
||||
const { data } = await http.post<Message>("/messages", { chat_id: chatId, text, type });
|
||||
return data;
|
||||
|
||||
Reference in New Issue
Block a user