File tree Expand file tree Collapse file tree 1 file changed +3
-3
lines changed
src/app/api/upcoming-papers Expand file tree Collapse file tree 1 file changed +3
-3
lines changed Original file line number Diff line number Diff line change @@ -3,6 +3,7 @@ import { connectToDatabase } from "@/lib/mongoose";
3
3
import Paper from "@/db/papers" ;
4
4
import UpcomingSlot from "@/db/upcoming-slot" ;
5
5
import UpcomingSubject from "@/db/upcoming-paper" ;
6
+ import next from "next" ;
6
7
7
8
export const dynamic = "force-dynamic" ;
8
9
@@ -19,12 +20,11 @@ export async function GET() {
19
20
{ status : 404 } ,
20
21
) ;
21
22
}
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" ] ;
23
25
const selectedSubjects = await UpcomingSubject . find ( {
24
26
slots : { $in : correspondingSlots } , // Match any slot in the array
25
27
} ) ;
26
- const subbbb = await UpcomingSubject . find ( { } ) ;
27
- console . log ( correspondingSlots , subbbb ) ;
28
28
if ( selectedSubjects . length === 0 ) {
29
29
return NextResponse . json (
30
30
{
You can’t perform that action at this time.
0 commit comments