Skip to content

Commit

Permalink
completed 90% successfully
Browse files Browse the repository at this point in the history
  • Loading branch information
Kannan112 committed Dec 21, 2023
1 parent c1d9f65 commit 085049b
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions pkg/api/handler/admin.go
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ func (cr *AdminHandler) CreateAdmin(c *gin.Context) {
})
return
}
_, err := cr.adminUseCase.CreateAdmin(c.Request.Context(), adminData)
adminDetails, err := cr.adminUseCase.CreateAdmin(c.Request.Context(), adminData)

if err != nil {
c.JSON(http.StatusBadRequest, res.Response{
Expand All @@ -59,7 +59,7 @@ func (cr *AdminHandler) CreateAdmin(c *gin.Context) {
c.JSON(http.StatusCreated, res.Response{
StatusCode: 200,
Message: "Admin created",
Data: nil,
Data: adminDetails,
Errors: nil,
})

Expand Down
2 changes: 1 addition & 1 deletion pkg/api/routers/admin.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ func SetupAdminRoutes(engine *gin.RouterGroup, adminHandler *handler.AdminHandle
admin := engine.Group("/admin")
{
// Admin routes
admin.POST("createadmin", adminHandler.CreateAdmin, middleware.AdminAuth)
admin.POST("createadmin", adminHandler.CreateAdmin)
admin.POST("adminlogin", adminHandler.AdminLogin)
admin.POST("logout", adminHandler.AdminLogout)

Expand Down

0 comments on commit 085049b

Please sign in to comment.