Skip to content

Commit

Permalink
error message and unused import
Browse files Browse the repository at this point in the history
  • Loading branch information
edalholt committed Sep 12, 2024
1 parent 84ff35b commit bf1b6c4
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions backend/controllers/group.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { Request, Response } from "express";
import { Response } from "express";
import { getAllGroups } from "ntnui-tools";
import { RequestWithNtnuiNo } from "../utils/request";

Expand All @@ -10,7 +10,8 @@ export const getGroups = async (
const groups = await getAllGroups(req.body.category);
return res.status(200).json(groups);
} catch (error) {
console.error("Error in getGroups controller:", error);
return res.status(500).json({ message: "Error fetching groups" });
return res
.status(500)
.json({ message: "Error while fetching groups from medlem" });
}
};

0 comments on commit bf1b6c4

Please sign in to comment.