Skip to content

Commit

Permalink
Revert "added expo endpoint"
Browse files Browse the repository at this point in the history
This reverts commit b4e2da8.
  • Loading branch information
pm3512 committed Feb 3, 2024
1 parent b4e2da8 commit c12f240
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 39 deletions.
17 changes: 0 additions & 17 deletions src/controllers/ProjectsController.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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";

Expand Down Expand Up @@ -181,22 +180,6 @@ export const getAllProjects = async (
}
};

export const getExpoProjects = async (
req: Request,
res: Response
): Promise<void> => {
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
Expand Down
22 changes: 0 additions & 22 deletions src/routes/projects.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ import {
editProject,
enterProject,
getAllProjects,
getExpoProjects,
getProjectByID,
} from "../controllers/ProjectsController";
import { asyncCatch } from "../util/asyncCatch";
Expand Down Expand Up @@ -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}:
Expand Down

0 comments on commit c12f240

Please sign in to comment.