Notify moderators about submitted reports#438
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Repository UI Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (2)
🚧 Files skipped from review as they are similar to previous changes (1)
WalkthroughRouters (web, mobile, PC) now delegate report creation to ReportSubmissionService which sanitizes input, enforces existence/self/duplicate checks, persists reports, and emits report.created notifications. Notification event types and recipient filtering/tests were added; admin UI links were adjusted. ChangesListing Report Creation Notifications
🎯 4 (Complex) | ⏱️ ~45 minutes Possibly related PRs:
Suggested labels: 🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
✨ Simplify code
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
🧹 Nitpick comments (1)
src/server/services/report-submission.service.ts (1)
89-102: 💤 Low valueInconsistent error handling pattern between listing and PC listing reports.
createListingReportusesResourceError.listingReport.*helpers for self-reporting and duplicate detection (lines 38, 50), whilecreatePcListingReportusesAppError.forbidden/conflictdirectly. Consider using a consistent approach (e.g.,ResourceError.pcListingReport.*if available, or standardize on AppError for both).🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@src/server/services/report-submission.service.ts` around lines 89 - 102, The createPcListingReport path uses AppError.forbidden and AppError.conflict while createListingReport uses ResourceError.listingReport.*; make them consistent by replacing AppError.forbidden and AppError.conflict in createPcListingReport with the corresponding ResourceError.pcListingReport.* helpers (e.g., ResourceError.pcListingReport.selfReport and ResourceError.pcListingReport.duplicateReport or the appropriate helper names), and add/import ResourceError if missing so both createListingReport and createPcListingReport use the same ResourceError-based pattern.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Nitpick comments:
In `@src/server/services/report-submission.service.ts`:
- Around line 89-102: The createPcListingReport path uses AppError.forbidden and
AppError.conflict while createListingReport uses ResourceError.listingReport.*;
make them consistent by replacing AppError.forbidden and AppError.conflict in
createPcListingReport with the corresponding ResourceError.pcListingReport.*
helpers (e.g., ResourceError.pcListingReport.selfReport and
ResourceError.pcListingReport.duplicateReport or the appropriate helper names),
and add/import ResourceError if missing so both createListingReport and
createPcListingReport use the same ResourceError-based pattern.
ℹ️ Review info
⚙️ Run configuration
Configuration used: Repository UI
Review profile: CHILL
Plan: Pro
Run ID: 9ef1fd07-c568-4f5d-849f-d0937f824146
📒 Files selected for processing (12)
src/app/admin/dashboard/components/ActivityCard/ReportActivityItem.tsxsrc/server/api/routers/listingReports.test.tssrc/server/api/routers/listingReports.tssrc/server/api/routers/mobile/listingReports.test.tssrc/server/api/routers/mobile/listingReports.tssrc/server/api/routers/pcListings.test.tssrc/server/api/routers/pcListings.tssrc/server/notifications/eventEmitter.tssrc/server/notifications/reportEvents.tssrc/server/notifications/service.test.tssrc/server/notifications/service.tssrc/server/services/report-submission.service.ts
🚧 Files skipped from review as they are similar to previous changes (3)
- src/server/notifications/service.test.ts
- src/server/api/routers/listingReports.test.ts
- src/server/api/routers/pcListings.test.ts
Description
Fixes #390
Type of change
How Has This Been Tested?
Commands run:
ESLint completed with 0 errors; existing React Compiler warnings remain outside this change.
Screenshots (if applicable)
N/A
Checklist
Notes for reviewers
No docs change needed.
Summary by CodeRabbit
New Features
Bug Fixes
Improvements