summaryrefslogtreecommitdiffstats
path: root/api4/params.go
diff options
context:
space:
mode:
authorRuzette Tanyag <ruzette@users.noreply.github.com>2017-02-28 04:14:16 -0500
committerGeorge Goldberg <george@gberg.me>2017-02-28 09:14:16 +0000
commitcef5028cbeed93b6493f6d1f379afe4ca85535c8 (patch)
tree6424b7878b372c6457845f933d7406c971399f79 /api4/params.go
parent758402311a97a053a5276049db6dce4f8f8dcfbc (diff)
downloadchat-cef5028cbeed93b6493f6d1f379afe4ca85535c8.tar.gz
chat-cef5028cbeed93b6493f6d1f379afe4ca85535c8.tar.bz2
chat-cef5028cbeed93b6493f6d1f379afe4ca85535c8.zip
Implemented preferences endpoints for apiv4 (#5531)
* implemented preferences endpoints for apiv4 * added user id in preferences endpoints
Diffstat (limited to 'api4/params.go')
-rw-r--r--api4/params.go38
1 files changed, 24 insertions, 14 deletions
diff --git a/api4/params.go b/api4/params.go
index 9b371e71a..b1688a859 100644
--- a/api4/params.go
+++ b/api4/params.go
@@ -17,20 +17,22 @@ const (
)
type ApiParams struct {
- UserId string
- TeamId string
- ChannelId string
- PostId string
- FileId string
- CommandId string
- HookId string
- EmojiId string
- Email string
- Username string
- TeamName string
- ChannelName string
- Page int
- PerPage int
+ UserId string
+ TeamId string
+ ChannelId string
+ PostId string
+ FileId string
+ CommandId string
+ HookId string
+ EmojiId string
+ Email string
+ Username string
+ TeamName string
+ ChannelName string
+ PreferenceName string
+ Category string
+ Page int
+ PerPage int
}
func ApiParamsFromRequest(r *http.Request) *ApiParams {
@@ -86,6 +88,14 @@ func ApiParamsFromRequest(r *http.Request) *ApiParams {
params.ChannelName = val
}
+ if val, ok := props["category"]; ok {
+ params.Category = val
+ }
+
+ if val, ok := props["preference_name"]; ok {
+ params.PreferenceName = val
+ }
+
if val, err := strconv.Atoi(r.URL.Query().Get("page")); err != nil {
params.Page = PAGE_DEFAULT
} else {