Skip to content

Commit

Permalink
Fixes admin routes
Browse files Browse the repository at this point in the history
  • Loading branch information
Aryan51203 committed Aug 27, 2024
1 parent a76c837 commit 01a24f0
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 18 deletions.
11 changes: 0 additions & 11 deletions api/admin.go
Original file line number Diff line number Diff line change
Expand Up @@ -31,17 +31,6 @@ func HandleCreateIdentityFlow(c *gin.Context) {
return
}

if err != nil {
log.ErrorLogger("Unable to convert JSON to map", err)

errCode, _ := strconv.Atoi(strings.Split(err.Error(), " ")[0])
c.JSON(errCode, gin.H{
"error": err.Error(),
"message": "Unable to convert JSON to map",
})
return
}

createdIdentity, r, err := admin.CreateIdentityFlowWrapper(t)

if err != nil {
Expand Down
14 changes: 7 additions & 7 deletions api/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -36,13 +36,13 @@ func Start() {
r.GET("/mfa", HandleGetMFAFlow)
r.POST("/mfa", HandlePostMFAFlow)

// r.POST("/create-identity", middleware.OnlyAdmin, HandleCreateIdentityFlow)
// r.GET("/get-identity", middleware.OnlyAdmin, HandleGetIdentityFlow)
// r.POST("/delete-identity", middleware.OnlyAdmin, HandleDeleteIdentityFlow)
// r.GET("/list-identity", middleware.OnlyAdmin, HandleListIdentity)
// r.PUT("/update-identity/ban", middleware.OnlyAdmin, HandleBanIdentity)
// r.PUT("/update-identity/remove-ban", middleware.OnlyAdmin, HandleRemoveBanIdentity)
// r.PUT("/update-identity/switch-roles", middleware.OnlyAdmin, HandleRoleSwitch)
r.POST("/create-identity", middleware.OnlyAdmin, HandleCreateIdentityFlow)
r.GET("/get-identity", middleware.OnlyAdmin, HandleGetIdentityFlow)
r.POST("/delete-identity", middleware.OnlyAdmin, HandleDeleteIdentityFlow)
r.GET("/list-identity", middleware.OnlyAdmin, HandleListIdentity)
r.PUT("/update-identity/ban", middleware.OnlyAdmin, HandleBanIdentity)
r.PUT("/update-identity/remove-ban", middleware.OnlyAdmin, HandleRemoveBanIdentity)
r.PUT("/update-identity/switch-roles", middleware.OnlyAdmin, HandleRoleSwitch)

r.GET("/register", HandleGetRegistrationFlow)
r.POST("/register", HandlePostRegistrationFlow)
Expand Down

0 comments on commit 01a24f0

Please sign in to comment.