diff options
author | Ruzette Tanyag <ruzette@users.noreply.github.com> | 2017-02-07 11:54:07 -0500 |
---|---|---|
committer | Christopher Speller <crspeller@gmail.com> | 2017-02-07 11:54:07 -0500 |
commit | d91fea65188a51dd41976cad47f9c8ebacd75a04 (patch) | |
tree | 792f8563d04957c1ddf56a731821051c8466eba7 /api4/params.go | |
parent | 5cc30fa06149e1291deed6f53de53ecf25600d2c (diff) | |
download | chat-d91fea65188a51dd41976cad47f9c8ebacd75a04.tar.gz chat-d91fea65188a51dd41976cad47f9c8ebacd75a04.tar.bz2 chat-d91fea65188a51dd41976cad47f9c8ebacd75a04.zip |
Implement GET `/users/email/{email}` endpoint for APIv4 (#5309)
* added get user by email endpoint for APIv4
* added get user by email endpoint unit test and driver
* removed the appended return of user ids on logout
* Added RequireEmail to validate user email. Also updated the get user by email endpoint and unit test
Diffstat (limited to 'api4/params.go')
-rw-r--r-- | api4/params.go | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/api4/params.go b/api4/params.go index 1c0c153ea..a043919fa 100644 --- a/api4/params.go +++ b/api4/params.go @@ -25,6 +25,7 @@ type ApiParams struct { CommandId string HookId string EmojiId string + Email string Page int PerPage int } @@ -66,6 +67,10 @@ func ApiParamsFromRequest(r *http.Request) *ApiParams { params.EmojiId = val } + if val, ok := props["email"]; ok { + params.Email = val + } + if val, err := strconv.Atoi(r.URL.Query().Get("page")); err != nil { params.Page = PAGE_DEFAULT } else { |