Skip to content

Commit 82a749a

Browse files
fix(api): use DB_NAME env variable in '/submission/latest' route
instead of hardcoded "dcs-test", use it as a fallback if DB_NAME env variable is unavailable
1 parent 1327bad commit 82a749a

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

app/api/submission/latest/route.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ export const GET = async (request: NextRequest) => {
2222
}
2323

2424
await client.connect();
25-
const db = client.db("dcs-test");
25+
const db = client.db(process.env.DB_NAME || "dcs-test");
2626

2727
// Find the latest submission for the given repo_name
2828
const latestSubmission = await db.collection("submissions").findOne(

0 commit comments

Comments
 (0)