Skip to content

Commit

Permalink
prettier?
Browse files Browse the repository at this point in the history
  • Loading branch information
txingxie committed Nov 21, 2024
1 parent 57e95f9 commit 7c66c90
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 3 deletions.
5 changes: 4 additions & 1 deletion api/src/controllers/mentorController.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,10 @@ import { Request, Response } from "express";
import { Mentor } from "../model/Mentor";

// Get all mentees and their workshops for a given mentor
export const getMenteesForMentor = async (req: Request, res: Response): Promise<void> => {
export const getMenteesForMentor = async (
req: Request,
res: Response,
): Promise<void> => {
try {
const { mentorId } = req.params;

Expand Down
4 changes: 3 additions & 1 deletion api/src/routes/mentee.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,9 @@ router.get("/:menteeId/workshops", async (req, res) => {
const workshops = await Workshop.find({ mentee: menteeId });
res.status(200).json(workshops);
} catch (error) {
res.status(500).json({ message: "Error retrieving workshops for mentee", error });
res
.status(500)
.json({ message: "Error retrieving workshops for mentee", error });
}
});

Expand Down
1 change: 0 additions & 1 deletion api/src/server.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@ app.use("/workshop", routes.workshop);

connectDB();


app.use("/api", router); // connect routes (prefix as api), what is the lin 7 logic for?: import * as routes from "./routes/index"

app.listen(process.env.PORT || 8000, () =>
Expand Down

0 comments on commit 7c66c90

Please sign in to comment.