diff --git a/src/controllers/ProjectsController.ts b/src/controllers/ProjectsController.ts index b00e0bf..e6c058d 100644 --- a/src/controllers/ProjectsController.ts +++ b/src/controllers/ProjectsController.ts @@ -6,7 +6,6 @@ import Team from "../models/Team"; import { bad, error, notFound } from "../util/error"; import { getTartanHacks } from "./EventController"; import { findUserTeam } from "./TeamController"; -import Checkin from "src/models/Checkin"; const GRAND_PRIZE_NAME = "Scott Krulcik Grand Prize"; @@ -181,22 +180,6 @@ export const getAllProjects = async ( } }; -export const getExpoProjects = async ( - req: Request, - res: Response -): Promise => { - const expoEventId = new ObjectId(process.env.EXPO_EVENT_ID); - const checkins = await Checkin.find({ item: expoEventId }); - const users = checkins.map((checkin) => checkin.user); - const teams = await Team.find({ members: { $in: users } }); - const teamIds = teams.map((team) => team._id); - const uniqueIds = new Set(teamIds); - const expoProjects = await Project.find({ - team: { $in: Array.from(uniqueIds) }, - }); - res.json(expoProjects); -}; - export const getProjectByTeamID = async ( req: Request, res: Response diff --git a/src/routes/projects.ts b/src/routes/projects.ts index 438a4c8..68ba3b2 100644 --- a/src/routes/projects.ts +++ b/src/routes/projects.ts @@ -5,7 +5,6 @@ import { editProject, enterProject, getAllProjects, - getExpoProjects, getProjectByID, } from "../controllers/ProjectsController"; import { asyncCatch } from "../util/asyncCatch"; @@ -146,27 +145,6 @@ router.post("/", isAuthenticated, asyncCatch(createNewProject)); */ router.patch("/:id", isProjectOwnerOrAdmin, asyncCatch(editProject)); -/** - * @swagger - * /projects/expo: - * get: - * summary: Get Projects that have been checked into the Expo - * security: - * - apiKeyAuth: [] - * tags: [Projects Module] - * description: Get all Projects. Access - Admin. - * responses: - * 200: - * description: Success. - * 400: - * description: Bad request - * 403: - * description: Unauthorized. - * 500: - * description: Internal Server Error. - */ -router.get("/expo/", isAdmin, asyncCatch(getExpoProjects)); - /** * @swagger * /projects/{id}: