Skip to content

Commit f2aceaf

Browse files
committed
fix: declaration in route.tsx
1 parent b753581 commit f2aceaf

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

src/lib/services/report.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ import { CustomError } from "@/lib/utils/error";
44

55
const exams: string[] = ["CAT-1", "CAT-2", "FAT", "Model CAT-1", "Model CAT-2", "Model FAT"]
66
const ALLOWED_FIELDS = ["subject", "courseCode", "exam", "slot", "year"];
7-
const MAX_REPORTS_PER_PAPER = 5;
7+
88

99
export interface ReportTagBody {
1010
paperId?: string;
@@ -21,10 +21,10 @@ interface ReportedFieldInput {
2121

2222
export async function reportTag(paperId: string, body: ReportTagBody) {
2323
await connectToDatabase();
24-
const MAX_REPORTS_PER_PAPER = 5;
24+
2525
const count = await TagReport.countDocuments({ paperId });
2626

27-
if (count >= MAX_REPORTS_PER_PAPER) {
27+
if (count >= 5){
2828
throw new CustomError("Received many reports; we are currently working on it.", 429)
2929
}
3030
const reportedFields: ReportedFieldInput[] = Array.isArray(body.reportedFields)

0 commit comments

Comments
 (0)