Skip to content

Commit 1320687

Browse files
committed
fix: build errors
1 parent a0ceddb commit 1320687

4 files changed

Lines changed: 10 additions & 10 deletions

File tree

app/api/analytics/route.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ export async function GET(request: NextRequest) {
5757
User.countDocuments({ role: "user" }),
5858
Team.countDocuments({}),
5959
Team.countDocuments({
60-
teamStatus: { $in: ["submitted", "under-review"] },
60+
teamStatus: "submitted",
6161
}),
6262
Team.countDocuments({ evaluations: { $exists: true, $ne: [] } }),
6363
Team.countDocuments({

app/api/cron/analytics-update/route.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,8 +19,8 @@ export async function GET(request: NextRequest) {
1919
const [totalUsers, totalTeams, totalSubmissions, totalEvaluated] = await Promise.all([
2020
User.countDocuments({ role: 'user' }),
2121
Team.countDocuments({}),
22-
Team.countDocuments({ teamStatus: { $in: ['submitted', 'under-review', 'shortlisted', 'accepted', 'rejected'] } }),
23-
Team.countDocuments({ teamStatus: { $in: ['shortlisted', 'accepted', 'rejected'] } }),
22+
Team.countDocuments({ teamStatus: { $in: ['submitted', 'shortlisted', 'rsvped', 'rsvp_declined'] } }),
23+
Team.countDocuments({ teamStatus: { $in: ['shortlisted', 'rsvped', 'rsvp_declined'] } }),
2424
]);
2525

2626
const registered = Math.max(0, totalTeams - (totalSubmissions + totalEvaluated));

app/shortlisted/page.tsx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ const itemVariants = {
2828
scale: 1,
2929
transition: {
3030
duration: 0.4,
31-
ease: [0.25, 0.46, 0.45, 0.94]
31+
ease: [0.25, 0.46, 0.45, 0.94] as const
3232
}
3333
}
3434
};
@@ -40,7 +40,7 @@ const heroVariants = {
4040
y: 0,
4141
transition: {
4242
duration: 0.6,
43-
ease: "easeOut"
43+
ease: "easeOut" as const
4444
}
4545
}
4646
};
@@ -52,7 +52,7 @@ const statVariants = {
5252
scale: 1,
5353
transition: {
5454
duration: 0.5,
55-
ease: "easeOut"
55+
ease: "easeOut" as const
5656
}
5757
}
5858
};

lib/db.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,6 @@ import mongoose from 'mongoose';
22

33
const MONGODB_URI = process.env.MONGODB_URI;
44

5-
if (!MONGODB_URI) {
6-
throw new Error('Please define the MONGODB_URI environment variable inside .env.local');
7-
}
8-
95
interface MongooseCache {
106
conn: mongoose.Connection | null;
117
promise: Promise<mongoose.Connection> | null;
@@ -22,6 +18,10 @@ if (!cached) {
2218
}
2319

2420
async function dbConnect() {
21+
if (!MONGODB_URI) {
22+
throw new Error('Please define the MONGODB_URI environment variable inside .env.local');
23+
}
24+
2525
if (cached.conn) {
2626
return cached.conn;
2727
}

0 commit comments

Comments
 (0)