feat: implement user reporting functionality with a dedicated modal and service, integrated into the chat header.

This commit is contained in:
pradeepkumar
2026-03-19 05:24:41 +05:30
parent 776aeaac8d
commit 3a5377dd35
4 changed files with 210 additions and 3 deletions

View File

@@ -0,0 +1,29 @@
import api, { ApiResponse } from './api';
interface CreateReportDto {
reportedUserId: string;
conversationId?: string;
reason: string;
description?: string;
}
interface UserReport {
id: string;
reporterId: string;
reportedUserId: string;
conversationId: string | null;
reason: string;
description: string | null;
status: string;
createdAt: string;
}
class UserReportsService {
async createReport(dto: CreateReportDto): Promise<UserReport> {
const response = await api.post<ApiResponse<UserReport>>('/user-reports', dto);
return response.data.data;
}
}
export const userReportsService = new UserReportsService();
export type { CreateReportDto, UserReport };