feat(core): clear saved chat and add message deletion scopes
Some checks failed
CI / test (push) Failing after 26s
Some checks failed
CI / test (push) Failing after 26s
backend:
- add message_hidden table for per-user message hiding
- support DELETE /messages/{id}?for_all=true|false
- implement delete-for-me vs delete-for-all logic by chat type/permissions
- add POST /chats/{chat_id}/clear and route saved chat deletion to clear
web:
- saved messages action changed from delete to clear
- message context menu now supports delete modal: for me / for everyone
- add local store helpers removeMessage/clearChatMessages
- include realtime stability improvements and app error boundary
This commit is contained in:
@@ -150,6 +150,14 @@ export async function deleteChat(chatId: number, forAll: boolean): Promise<void>
|
||||
await http.delete(`/chats/${chatId}`, { params: { for_all: forAll } });
|
||||
}
|
||||
|
||||
export async function clearChat(chatId: number): Promise<void> {
|
||||
await http.post(`/chats/${chatId}/clear`);
|
||||
}
|
||||
|
||||
export async function deleteMessage(messageId: number, forAll = false): Promise<void> {
|
||||
await http.delete(`/messages/${messageId}`, { params: { for_all: forAll } });
|
||||
}
|
||||
|
||||
export async function discoverChats(query?: string): Promise<DiscoverChat[]> {
|
||||
const { data } = await http.get<DiscoverChat[]>("/chats/discover", {
|
||||
params: query?.trim() ? { query: query.trim() } : undefined
|
||||
|
||||
Reference in New Issue
Block a user