feat(privacy): user blocklist with private chat enforcement
Some checks failed
CI / test (push) Failing after 21s
Some checks failed
CI / test (push) Failing after 21s
- add blocked_users table and migration - add users API: block, unblock, list blocked users - prevent private chat creation and private messaging when block relation exists - add block/unblock action in private chat info panel
This commit is contained in:
@@ -24,3 +24,16 @@ export async function getUserById(userId: number): Promise<AuthUser> {
|
||||
const { data } = await http.get<AuthUser>(`/users/${userId}`);
|
||||
return data;
|
||||
}
|
||||
|
||||
export async function listBlockedUsers(): Promise<UserSearchItem[]> {
|
||||
const { data } = await http.get<UserSearchItem[]>("/users/blocked");
|
||||
return data;
|
||||
}
|
||||
|
||||
export async function blockUser(userId: number): Promise<void> {
|
||||
await http.post(`/users/${userId}/block`);
|
||||
}
|
||||
|
||||
export async function unblockUser(userId: number): Promise<void> {
|
||||
await http.delete(`/users/${userId}/block`);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user