From e850bd381b69c8a9ad0c3f117c11b34cf328a313 Mon Sep 17 00:00:00 2001 From: konpoku <543329382@qq.com> Date: Sun, 27 Oct 2024 22:37:03 +0800 Subject: [PATCH] modified routes return value --- src/routes/application.ts | 4 ++-- src/routes/mentor.ts | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/routes/application.ts b/src/routes/application.ts index 5ae2e499..0a9e4edc 100644 --- a/src/routes/application.ts +++ b/src/routes/application.ts @@ -329,10 +329,10 @@ router.post("/chat/update/status",authenticate(["counselor","teacher"]), async ( return res.status(455).send("Error: Application does not exist"); } if(chat_status === true){ - return res.status(200).send("true"); + return res.status(200).json({chat_status: true}); } else{ - return res.status(200).send("false"); + return res.status(200).json({chat_status: false}); } } catch (err) { console.log(err) diff --git a/src/routes/mentor.ts b/src/routes/mentor.ts index b0332586..2240d5a0 100644 --- a/src/routes/mentor.ts +++ b/src/routes/mentor.ts @@ -25,7 +25,7 @@ router.post("/update/available", authenticate(["counselor", "teacher"]), async ( return res.status(422).send("422 Unprocessable Entity: Missing credentials"); } const mentor_available = await MentHasFunc.update_mentor_info_available(uuid, available); - return res.status(200).send(mentor_available); + return res.status(200).json({mentor_available: mentor_available}); } catch (err) { return res.status(500).send("Internal Server Error"); }