aboutsummaryrefslogtreecommitdiffhomepage
path: root/server/api/controller/user.go
diff options
context:
space:
mode:
authorGravatar Frédéric Guillot <fred@miniflux.net>2017-11-21 18:14:45 -0800
committerGravatar Frédéric Guillot <fred@miniflux.net>2017-11-21 18:14:45 -0800
commit25cbd657771a67ef41abac4089a231369b96276e (patch)
treee029a9de97f2994b2533e0e9977405d7463d5533 /server/api/controller/user.go
parent4fc18647ca73fed5cc3357eb0b50bcff8263f171 (diff)
Improve Request to be more idiomatic
Diffstat (limited to 'server/api/controller/user.go')
-rw-r--r--server/api/controller/user.go10
1 files changed, 5 insertions, 5 deletions
diff --git a/server/api/controller/user.go b/server/api/controller/user.go
index c8276b3..62c8a49 100644
--- a/server/api/controller/user.go
+++ b/server/api/controller/user.go
@@ -17,7 +17,7 @@ func (c *Controller) CreateUser(ctx *core.Context, request *core.Request, respon
return
}
- user, err := payload.DecodeUserPayload(request.GetBody())
+ user, err := payload.DecodeUserPayload(request.Body())
if err != nil {
response.Json().BadRequest(err)
return
@@ -50,13 +50,13 @@ func (c *Controller) UpdateUser(ctx *core.Context, request *core.Request, respon
return
}
- userID, err := request.GetIntegerParam("userID")
+ userID, err := request.IntegerParam("userID")
if err != nil {
response.Json().BadRequest(err)
return
}
- user, err := payload.DecodeUserPayload(request.GetBody())
+ user, err := payload.DecodeUserPayload(request.Body())
if err != nil {
response.Json().BadRequest(err)
return
@@ -110,7 +110,7 @@ func (c *Controller) GetUser(ctx *core.Context, request *core.Request, response
return
}
- userID, err := request.GetIntegerParam("userID")
+ userID, err := request.IntegerParam("userID")
if err != nil {
response.Json().BadRequest(err)
return
@@ -137,7 +137,7 @@ func (c *Controller) RemoveUser(ctx *core.Context, request *core.Request, respon
return
}
- userID, err := request.GetIntegerParam("userID")
+ userID, err := request.IntegerParam("userID")
if err != nil {
response.Json().BadRequest(err)
return