diff --git a/backend/src/dal/report.ts b/backend/src/dal/report.ts index d0d0662d2..8e2414085 100644 --- a/backend/src/dal/report.ts +++ b/backend/src/dal/report.ts @@ -35,5 +35,13 @@ export async function createReport( ); } + const countFromUserMakingReport = sameReports.filter((r) => { + return r.uid === report.uid; + }).length; + + if (countFromUserMakingReport > 0) { + throw new MonkeyError(409, "You have already reported this content."); + } + await db.collection(COLLECTION_NAME).insertOne(report); }