Skip to content

Commit

Permalink
new points collection for s25 hackathon
Browse files Browse the repository at this point in the history
  • Loading branch information
ethxng committed Jan 25, 2025
1 parent 0b1b4b7 commit 2d0cd8b
Show file tree
Hide file tree
Showing 5 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion src/functions/attend-event/handler.ts
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,7 @@ const attendEvent: ValidatedEventAPIGatewayProxyEvent<typeof schema> = 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({
Expand Down
2 changes: 1 addition & 1 deletion src/functions/get-buy-ins/handler.ts
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ const getBuyIns: ValidatedEventAPIGatewayProxyEvent<typeof schema> = 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([
Expand Down
2 changes: 1 addition & 1 deletion src/functions/leaderboard/handler.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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([
Expand Down
2 changes: 1 addition & 1 deletion src/functions/points/handler.ts
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ const points: ValidatedEventAPIGatewayProxyEvent<typeof schema> = 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 });
Expand Down
2 changes: 1 addition & 1 deletion src/functions/update-buy-ins/handler.ts
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ const updateBuyIns: ValidatedEventAPIGatewayProxyEvent<typeof schema> = 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) {
Expand Down

0 comments on commit 2d0cd8b

Please sign in to comment.