Skip to content

Commit

Permalink
pr fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
riyap committed Jun 25, 2024
1 parent ac7e5ae commit fb4a417
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 5 deletions.
6 changes: 2 additions & 4 deletions src/services/events/events-router.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import { Router } from "express";
import { StatusCodes } from "http-status-codes";
import { publicEventValidator } from "./events-schema";
import { Database } from "../../database";
import { checkInUser } from "./events-utils";
import { checkInUserToEvent } from "./events-utils";
// import {mongoose} from "mongoose";

const eventsRouter = Router();
Expand Down Expand Up @@ -104,9 +104,7 @@ eventsRouter.delete("/:EVENTID", async (req, res, next) => {
eventsRouter.post("/check-in", async (req, res, next) => {
try {
const { eventId, userId } = req.body;
console.log(eventId);
console.log(userId);
const result = await checkInUser(eventId, userId);
const result = await checkInUserToEvent(eventId, userId);
if (result.success) {
return res
.status(StatusCodes.OK)
Expand Down
2 changes: 1 addition & 1 deletion src/services/events/events-utils.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { Database } from "../../database";

export async function checkInUser(eventId: string, userId: string) {
export async function checkInUserToEvent(eventId: string, userId: string) {
// Check if the event and attendee exist
const [event, attendee] = await Promise.all([
Database.EVENTS.findOne({ eventId }),
Expand Down

0 comments on commit fb4a417

Please sign in to comment.