Skip to content

Commit

Permalink
fix returns
Browse files Browse the repository at this point in the history
  • Loading branch information
michelleli01 committed Nov 26, 2023
1 parent 1601fe9 commit b6ede16
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 8 deletions.
2 changes: 1 addition & 1 deletion server/src/auth/auth.router.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ router.post('/isAdmin', async (req, res) => {
const verify = await verifyAdminToken(adminRequest.token);

if (verify === false) {
res.status(400).json({ error: `Unable to verify token: ${adminRequest.token} as an admin.` });
return res.status(400).json({ error: `Unable to verify token: ${adminRequest.token} as an admin.` });
}

res.status(200).json({ message: `Token: ${adminRequest.token} was successfully verified as an admin user.` });
Expand Down
8 changes: 4 additions & 4 deletions server/src/profile/profile.router.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ router.post('/getStudentEmailByToken', async (req, res) => {
const email = await getUserEmail(token);

if (!email) {
res.status(400).json({ message: `Email not found: ${email}` });
return res.status(400).json({ message: `Email not found: ${email}` });
}

res.status(200).json({ message: email });
Expand All @@ -33,7 +33,7 @@ router.post('/countReviewsByStudentId', async (req, res) => {
try {
const studentDoc = await getUserByNetId(netId);
if (studentDoc === null) {
res.status(404).json({
return res.status(404).json({
message: `Unable to find student with netId: ${netId}`,
});
}
Expand All @@ -58,7 +58,7 @@ router.post('/getTotalLikesByStudentId', async (req, res) => {
try {
const studentDoc = await getUserByNetId(netId);
if (studentDoc === null) {
res.status(404).json({
return res.status(404).json({
message: `Unable to find student with netId: ${netId}`,
});
}
Expand Down Expand Up @@ -94,7 +94,7 @@ router.post('/getReviewsbyStudentId', async (req, res) => {
try {
const studentDoc = await getUserByNetId(netId);
if (studentDoc === null) {
res.status(404).json({
return res.status(404).json({
message: `Unable to find student with netId: ${netId}`,
});
}
Expand Down
6 changes: 3 additions & 3 deletions server/src/review/review.router.ts
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ router.post('/getCourseById', async (req, res) => {
const { courseId } = req.body as CourseIdQuery;
try {
const course = await getCourseByIdCallback(courseId);
res.status(200).json({
return res.status(200).json({
message: `Successfully retrieved course by id ${courseId}`,
data: course,
});
Expand All @@ -53,7 +53,7 @@ router.post('/getCourseByInfo', async (req, res) => {
const { number, subject } = req.body as ClassByInfoQuery;
try {
const course = await getClassByInfo(subject, number);
res.status(200).json({
return res.status(200).json({
message: `Successfully retrieved course by info number: ${number} and subject: ${subject}`,
data: course,
});
Expand All @@ -62,7 +62,7 @@ router.post('/getCourseByInfo', async (req, res) => {
console.log("Error: at 'getCourseByInfo' endpoint");
// eslint-disable-next-line no-console
console.log(error);
res.status(500).json({ error: 'Internal Server Error' });
return res.status(500).json({ error: 'Internal Server Error' });
}
});

Expand Down

0 comments on commit b6ede16

Please sign in to comment.