From 596533753c6aeae175abde68e86ea794fb771e31 Mon Sep 17 00:00:00 2001 From: Braeden Sowinski Date: Fri, 10 Jun 2022 12:28:50 -0700 Subject: [PATCH] remove deprecated test response --- controllers/updateController.go | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/controllers/updateController.go b/controllers/updateController.go index 8513bad..76a7e02 100644 --- a/controllers/updateController.go +++ b/controllers/updateController.go @@ -320,7 +320,7 @@ func UpdateStudentPassword(c *fiber.Ctx) error { }, } - result, updateErr := studentCollection.UpdateOne( + _, updateErr := studentCollection.UpdateOne( ctx, bson.M{"schooldata.sid": claims.Issuer}, update, @@ -350,7 +350,6 @@ func UpdateStudentPassword(c *fiber.Ctx) error { return c.Status(fiber.StatusOK).JSON(fiber.Map{ "success": true, "message": "successfully updated student password", - "result": result, }) } @@ -935,6 +934,14 @@ func UpdateStudentEmail(c *fiber.Ctx) error { }) } + if verifiedAdmin && data["sid"] == "" { + cancel() + return c.Status(fiber.StatusBadRequest).JSON(fiber.Map{ + "success": false, + "message": "missing required fields", + }) + } + // Check required fields are included if data["email"] == "" { cancel()