- Added `ReportDialog` component for user-generated content reporting. - Integrated `ReportService` with create, update, and fetch report functionalities. - Enhanced `AuthService` with 2FA setup, enable, disable, and verification methods. - Updated types to include 2FA responses and reporting-related data. - Enhanced `ContentCard` UI to support reporting functionality. - Improved admin services to manage user reports and statuses.
41 lines
756 B
TypeScript
41 lines
756 B
TypeScript
import api from "@/lib/api";
|
|
|
|
export enum ReportReason {
|
|
INAPPROPRIATE = "inappropriate",
|
|
SPAM = "spam",
|
|
COPYRIGHT = "copyright",
|
|
OTHER = "other",
|
|
}
|
|
|
|
export enum ReportStatus {
|
|
PENDING = "pending",
|
|
REVIEWED = "reviewed",
|
|
RESOLVED = "resolved",
|
|
DISMISSED = "dismissed",
|
|
}
|
|
|
|
export interface CreateReportPayload {
|
|
contentId?: string;
|
|
tagId?: string;
|
|
reason: ReportReason;
|
|
description?: string;
|
|
}
|
|
|
|
export interface Report {
|
|
uuid: string;
|
|
reporterId: string;
|
|
contentId?: string;
|
|
tagId?: string;
|
|
reason: ReportReason;
|
|
description?: string;
|
|
status: ReportStatus;
|
|
createdAt: string;
|
|
updatedAt: string;
|
|
}
|
|
|
|
export const ReportService = {
|
|
async create(payload: CreateReportPayload): Promise<void> {
|
|
await api.post("/reports", payload);
|
|
},
|
|
};
|