Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/app/(routes)/dashboard/analytics/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ export default function AnalyticsDashboard() {
try {
const end = new Date();
const start = new Date();
start.setDate(end.getDate() - parseInt(dateRange));
start.setDate(end.getDate() - parseInt(dateRange, 10));

let url = `/api/teacher/analytics?startDate=${start.toISOString()}&endDate=${end.toISOString()}`;
if (selectedClassroom !== "all") {
Expand Down
4 changes: 2 additions & 2 deletions src/app/api/doubts/action/[id]/route.ts
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ export async function PATCH(req: Request, { params }: { params: Promise<{ id: st
const email = user?.primaryEmailAddress?.emailAddress;

const { id } = await params;
const doubtId = parseInt(id);
const doubtId = parseInt(id, 10);

if (isNaN(doubtId)) {
return NextResponse.json({ error: "Invalid doubt ID" }, { status: 400 });
Expand Down Expand Up @@ -320,7 +320,7 @@ export async function DELETE(req: Request, { params }: { params: Promise<{ id: s
}

const { id } = await params;
const doubtId = parseInt(id);
const doubtId = parseInt(id, 10);

const [doubt] = await db.select().from(doubtsTable).where(and(eq(doubtsTable.id, doubtId), isNull(doubtsTable.deletedAt))).limit(1);
if (!doubt) return NextResponse.json({ error: "Doubt not found" }, { status: 404 });
Expand Down
Loading