From 2d0cd8b479b788bf4651def1ee04f48c5d943891 Mon Sep 17 00:00:00 2001 From: Ethan Nguyen Date: Sat, 25 Jan 2025 16:55:52 -0500 Subject: [PATCH] new points collection for s25 hackathon --- src/functions/attend-event/handler.ts | 2 +- src/functions/get-buy-ins/handler.ts | 2 +- src/functions/leaderboard/handler.ts | 2 +- src/functions/points/handler.ts | 2 +- src/functions/update-buy-ins/handler.ts | 2 +- 5 files changed, 5 insertions(+), 5 deletions(-) diff --git a/src/functions/attend-event/handler.ts b/src/functions/attend-event/handler.ts index 8a95080..1e60b5c 100644 --- a/src/functions/attend-event/handler.ts +++ b/src/functions/attend-event/handler.ts @@ -109,7 +109,7 @@ const attendEvent: ValidatedEventAPIGatewayProxyEvent = async (ev } if (event.body.points) { - const points = db.getCollection('f24-points-syst'); + const points = db.getCollection('s25-points-syst'); const userPoints = await points.findOne({ email: event.body.qr }); if (!userPoints) { await points.insertOne({ diff --git a/src/functions/get-buy-ins/handler.ts b/src/functions/get-buy-ins/handler.ts index 46e9dd6..11ac896 100644 --- a/src/functions/get-buy-ins/handler.ts +++ b/src/functions/get-buy-ins/handler.ts @@ -25,7 +25,7 @@ const getBuyIns: ValidatedEventAPIGatewayProxyEvent = async (even // Connect to DB const db = MongoDB.getInstance(process.env.MONGO_URI); await db.connect(); - const points = db.getCollection('f24-points-syst'); + const points = db.getCollection('s25-points-syst'); const buyIns = await points .aggregate([ diff --git a/src/functions/leaderboard/handler.ts b/src/functions/leaderboard/handler.ts index bd32cb7..75e09aa 100644 --- a/src/functions/leaderboard/handler.ts +++ b/src/functions/leaderboard/handler.ts @@ -10,7 +10,7 @@ const leaderboard: APIGatewayProxyHandler = async () => { try { const db = MongoDB.getInstance(process.env.MONGO_URI); await db.connect(); - const points = db.getCollection('f24-points-syst'); + const points = db.getCollection('s25-points-syst'); const topPlayers = await points .aggregate([ diff --git a/src/functions/points/handler.ts b/src/functions/points/handler.ts index bf6a742..48ace32 100644 --- a/src/functions/points/handler.ts +++ b/src/functions/points/handler.ts @@ -26,7 +26,7 @@ const points: ValidatedEventAPIGatewayProxyEvent = async (event) const db = MongoDB.getInstance(process.env.MONGO_URI); await db.connect(); const users = db.getCollection('users'); - const pointsCollection = db.getCollection('f24-points-syst'); + const pointsCollection = db.getCollection('s25-points-syst'); // Make sure user exists const user = await users.findOne({ email: email }); diff --git a/src/functions/update-buy-ins/handler.ts b/src/functions/update-buy-ins/handler.ts index fa954dc..b047998 100644 --- a/src/functions/update-buy-ins/handler.ts +++ b/src/functions/update-buy-ins/handler.ts @@ -26,7 +26,7 @@ const updateBuyIns: ValidatedEventAPIGatewayProxyEvent = async (e // connect to DB const db = MongoDB.getInstance(process.env.MONGO_URI); await db.connect(); - const pointCollection = db.getCollection('f24-points-syst'); + const pointCollection = db.getCollection('s25-points-syst'); const userPoints = await pointCollection.findOne({ email: event.body.email }); if (!userPoints || !userPoints.total_points || !userPoints.balance) {