Add 'Mark as Cleaned Up' functionality
- Add cleaned_at and cleaned_by_user_id fields to reports table - Create database migration for cleanup tracking - Add markAsCleaned backend endpoint and service method - Add Mark as Cleaned Up button to ReportDetailModal - Update types to include cleaned fields - Add frontend handler to mark reports as cleaned
This commit is contained in:
@@ -330,6 +330,29 @@ export class ReportService {
|
||||
data: { verificationStatus: status },
|
||||
});
|
||||
}
|
||||
|
||||
async markAsCleaned(reportId: string, userId: string) {
|
||||
// Check if report exists
|
||||
const report = await prisma.report.findUnique({
|
||||
where: { id: reportId },
|
||||
});
|
||||
|
||||
if (!report) {
|
||||
throw new Error('Report not found');
|
||||
}
|
||||
|
||||
// Mark as cleaned
|
||||
await prisma.report.update({
|
||||
where: { id: reportId },
|
||||
data: {
|
||||
cleanedAt: new Date(),
|
||||
cleanedByUserId: userId,
|
||||
},
|
||||
});
|
||||
|
||||
// Return updated report
|
||||
return this.getReportById(reportId);
|
||||
}
|
||||
}
|
||||
|
||||
export const reportService = new ReportService();
|
||||
|
||||
Reference in New Issue
Block a user