aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/user/controller.go
diff options
context:
space:
mode:
Diffstat (limited to 'user/controller.go')
-rw-r--r--user/controller.go24
1 files changed, 12 insertions, 12 deletions
diff --git a/user/controller.go b/user/controller.go
index 7dd519a..3b8c587 100644
--- a/user/controller.go
+++ b/user/controller.go
@@ -18,32 +18,32 @@
package user
import (
- e "vidhukant.com/openbills/errors"
"github.com/gin-gonic/gin"
"net/http"
+ e "vidhukant.com/openbills/errors"
)
-func handleGetUser (ctx *gin.Context) {
+func handleGetUser(ctx *gin.Context) {
var user User
- uId, ok := ctx.Get("UserID")
- if !ok {
- ctx.Error(e.ErrUnauthorized)
- ctx.Abort()
- return
- }
+ uId, ok := ctx.Get("UserID")
+ if !ok {
+ ctx.Error(e.ErrUnauthorized)
+ ctx.Abort()
+ return
+ }
- userId := uId.(uint)
+ userId := uId.(uint)
- err := GetUserById(&user, userId)
+ err := GetUserById(&user, userId)
if err != nil {
ctx.Error(err)
ctx.Abort()
return
}
- // remove password hash from response
- user.Password = ""
+ // remove password hash from response
+ user.Password = ""
ctx.JSON(http.StatusOK, gin.H{
"data": user,