feat(contacts): add contacts module with backend APIs and web tab
Some checks failed
CI / test (push) Failing after 18s
Some checks failed
CI / test (push) Failing after 18s
- add user_contacts table and migration - expose /users/contacts list/add/remove endpoints - add Contacts tab in chat list with add/remove actions
This commit is contained in:
@@ -38,3 +38,16 @@ export async function blockUser(userId: number): Promise<void> {
|
||||
export async function unblockUser(userId: number): Promise<void> {
|
||||
await http.delete(`/users/${userId}/block`);
|
||||
}
|
||||
|
||||
export async function listContacts(): Promise<UserSearchItem[]> {
|
||||
const { data } = await http.get<UserSearchItem[]>("/users/contacts");
|
||||
return data;
|
||||
}
|
||||
|
||||
export async function addContact(userId: number): Promise<void> {
|
||||
await http.post(`/users/${userId}/contacts`);
|
||||
}
|
||||
|
||||
export async function removeContact(userId: number): Promise<void> {
|
||||
await http.delete(`/users/${userId}/contacts`);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user