update/router-handler
This commit is contained in:
1 parent
ae01dd80cc
commit
38667718a2
2 files changed
+14
-6
No files matched your search
@@ -309,7 +309,7 @@ func ResetStudentPassword(c *fiber.Ctx) error {
|
|||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
// Check required fields are included
|
// Check required fields are included (email must be personal email)
|
||||||
if data["sid"] == "" || data["email"] == "" {
|
if data["sid"] == "" || data["email"] == "" {
|
||||||
cancel()
|
cancel()
|
||||||
return c.Status(fiber.StatusBadRequest).JSON(fiber.Map{
|
return c.Status(fiber.StatusBadRequest).JSON(fiber.Map{
|
||||||
|
|||||||
+13
-5
@@ -9,12 +9,12 @@ import (
|
|||||||
func Setup(app *fiber.App) {
|
func Setup(app *fiber.App) {
|
||||||
// API Handling
|
// API Handling
|
||||||
|
|
||||||
// Login + Register handling
|
// Student Authentication Handler
|
||||||
app.Get("/api/student", controllers.Student)
|
app.Get("/api/student", controllers.Student)
|
||||||
app.Post("/api/student/enroll", controllers.Enroll)
|
app.Post("/api/student/enroll", controllers.Enroll)
|
||||||
app.Post("/api/student/login", controllers.StudentLogin)
|
app.Post("/api/student/login", controllers.StudentLogin)
|
||||||
|
|
||||||
// Updating handling
|
// Update Student Handler
|
||||||
app.Post("/api/student/updateName", controllers.UpdateStudentName)
|
app.Post("/api/student/updateName", controllers.UpdateStudentName)
|
||||||
app.Post("/api/student/updateGradeLevel", controllers.UpdateStudentGradeLevel)
|
app.Post("/api/student/updateGradeLevel", controllers.UpdateStudentGradeLevel)
|
||||||
app.Post("/api/student/updateHomeroom", controllers.UpdateStudentHomeroom)
|
app.Post("/api/student/updateHomeroom", controllers.UpdateStudentHomeroom)
|
||||||
@@ -26,7 +26,7 @@ func Setup(app *fiber.App) {
|
|||||||
app.Post("/api/student/updatePhoto", controllers.UpdateStudentPhoto)
|
app.Post("/api/student/updatePhoto", controllers.UpdateStudentPhoto)
|
||||||
app.Post("/api/student/updateEmail", controllers.UpdateStudentEmail)
|
app.Post("/api/student/updateEmail", controllers.UpdateStudentEmail)
|
||||||
|
|
||||||
// Student Contacts
|
// Student Contact Handler
|
||||||
app.Post("/api/student/createContact", controllers.CreateContact)
|
app.Post("/api/student/createContact", controllers.CreateContact)
|
||||||
app.Post("/api/student/contact/updateName", controllers.UpdateContactName)
|
app.Post("/api/student/contact/updateName", controllers.UpdateContactName)
|
||||||
app.Post("/api/student/contact/updateAddress", controllers.UpdateContactAddress)
|
app.Post("/api/student/contact/updateAddress", controllers.UpdateContactAddress)
|
||||||
@@ -35,12 +35,12 @@ func Setup(app *fiber.App) {
|
|||||||
app.Post("/api/student/contact/updatePriority", controllers.UpdateContactPriority)
|
app.Post("/api/student/contact/updatePriority", controllers.UpdateContactPriority)
|
||||||
app.Post("/api/student/contact/removeContact", controllers.RemoveContact)
|
app.Post("/api/student/contact/removeContact", controllers.RemoveContact)
|
||||||
|
|
||||||
// Login + Register handling
|
// Teacher Login Handling
|
||||||
app.Get("/api/teacher", controllers.Teacher)
|
app.Get("/api/teacher", controllers.Teacher)
|
||||||
app.Post("/api/teacher/register", controllers.RegisterTeacher)
|
app.Post("/api/teacher/register", controllers.RegisterTeacher)
|
||||||
app.Post("/api/teacher/login", controllers.TeacherLogin)
|
app.Post("/api/teacher/login", controllers.TeacherLogin)
|
||||||
|
|
||||||
// Updating handling
|
// Update Teacher Handler
|
||||||
app.Post("/api/teacher/updatePassword", controllers.UpdateTeacherPassword)
|
app.Post("/api/teacher/updatePassword", controllers.UpdateTeacherPassword)
|
||||||
app.Post("/api/teacher/updateAddress", controllers.UpdateTeacherAddress)
|
app.Post("/api/teacher/updateAddress", controllers.UpdateTeacherAddress)
|
||||||
app.Post("/api/teacher/updatePhoto", controllers.UpdateTeacherPhoto)
|
app.Post("/api/teacher/updatePhoto", controllers.UpdateTeacherPhoto)
|
||||||
@@ -50,4 +50,12 @@ func Setup(app *fiber.App) {
|
|||||||
|
|
||||||
// General Routes
|
// General Routes
|
||||||
app.Post("/api/logout", controllers.Logout)
|
app.Post("/api/logout", controllers.Logout)
|
||||||
|
|
||||||
|
// Admin Login Handling
|
||||||
|
app.Get("/api/admin", controllers.Admin)
|
||||||
|
app.Post("/api/admin/create", controllers.CreateAdmin)
|
||||||
|
app.Post("/api/admin/login", controllers.AdminLogin)
|
||||||
|
|
||||||
|
// General Command Handling
|
||||||
|
app.Post("/api/admin/updateLockerCombo", controllers.UpdateLockerCombo)
|
||||||
}
|
}
|
||||||
Reference in new issue
Block a user