From bb647950d0b3ec1f8b90418aa3b0a82f5fbf966d Mon Sep 17 00:00:00 2001 From: Harsh Khandeparkar Date: Sat, 13 Jan 2024 15:38:54 +0530 Subject: [PATCH] feat: used the reg env var --- server/routes.go | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/server/routes.go b/server/routes.go index 4ac191d..261f070 100644 --- a/server/routes.go +++ b/server/routes.go @@ -2,6 +2,7 @@ package server import ( "net/http" + "os" "github.com/kossiitkgp/kwoc-backend/v2/controllers" "github.com/kossiitkgp/kwoc-backend/v2/middleware" @@ -57,7 +58,7 @@ func getRoutes(app *middleware.App) []Route { "POST", "/student/form/", middleware.WithLogin(middleware.WrapApp(app, controllers.RegisterStudent)), - true, + os.Getenv("REGISTRATIONS_OPEN") == "true", }, { "Update Student Details", @@ -85,7 +86,7 @@ func getRoutes(app *middleware.App) []Route { "POST", "/mentor/form/", middleware.WithLogin(middleware.WrapApp(app, controllers.RegisterMentor)), - true, + os.Getenv("REGISTRATIONS_OPEN") == "true", }, { "Update Mentor Details", @@ -120,7 +121,7 @@ func getRoutes(app *middleware.App) []Route { "POST", "/project/", middleware.WithLogin(middleware.WrapApp(app, controllers.RegisterProject)), - true, + os.Getenv("REGISTRATIONS_OPEN") == "true", }, { "Fetch All Projects",