feat(privacy): user blocklist with private chat enforcement
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:
2026-03-08 02:19:37 +03:00
parent ea8a50ee05
commit 159a8ba516
9 changed files with 228 additions and 6 deletions

View File

@@ -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`);
}