Skip to content

Commit b5836ef

Browse files
authored
Merge pull request #178 from CodeChefVIT/nextSlot
feat: display paper from both this and next slot
2 parents c68d7fa + cf4c139 commit b5836ef

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

src/app/api/upcoming-papers/route.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ import { connectToDatabase } from "@/lib/mongoose";
33
import Paper from "@/db/papers";
44
import UpcomingSlot from "@/db/upcoming-slot";
55
import UpcomingSubject from "@/db/upcoming-paper";
6+
import next from "next";
67

78
export const dynamic = "force-dynamic";
89

@@ -19,12 +20,11 @@ export async function GET() {
1920
{ status: 404 },
2021
);
2122
}
22-
const correspondingSlots = [slot + "1", slot + "2"];
23+
const nextSlot = String.fromCharCode(slot.charCodeAt(0) + 1)
24+
const correspondingSlots = [slot + "1", slot + "2", nextSlot + "1", nextSlot + "2"];
2325
const selectedSubjects = await UpcomingSubject.find({
2426
slots: { $in: correspondingSlots }, // Match any slot in the array
2527
});
26-
const subbbb = await UpcomingSubject.find({});
27-
console.log(correspondingSlots, subbbb);
2828
if (selectedSubjects.length === 0) {
2929
return NextResponse.json(
3030
{

0 commit comments

Comments
 (0)