diff options
author | Joram Wilander <jwawilander@gmail.com> | 2017-02-02 09:04:36 -0500 |
---|---|---|
committer | GitHub <noreply@github.com> | 2017-02-02 09:04:36 -0500 |
commit | 609d4f43d9eef504d852fbf02af5473b0d1424c8 (patch) | |
tree | 63fe24f08d5364501d3afed7c44b6739719d86e3 /store | |
parent | 2ac4f36587b8b217dcfd53e67c650c8ad27c75df (diff) | |
download | chat-609d4f43d9eef504d852fbf02af5473b0d1424c8.tar.gz chat-609d4f43d9eef504d852fbf02af5473b0d1424c8.tar.bz2 chat-609d4f43d9eef504d852fbf02af5473b0d1424c8.zip |
Implement POST /channels endpoint for APIv4 (#5241)
Diffstat (limited to 'store')
-rw-r--r-- | store/sql_channel_store.go | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/store/sql_channel_store.go b/store/sql_channel_store.go index 7e90a6d27..a8474be80 100644 --- a/store/sql_channel_store.go +++ b/store/sql_channel_store.go @@ -6,6 +6,7 @@ package store import ( "database/sql" "fmt" + "net/http" "strconv" "strings" @@ -223,7 +224,7 @@ func (s SqlChannelStore) saveChannelT(transaction *gorp.Transaction, channel *mo if dupChannel.DeleteAt > 0 { result.Err = model.NewLocAppError("SqlChannelStore.Save", "store.sql_channel.save_channel.previously.app_error", nil, "id="+channel.Id+", "+err.Error()) } else { - result.Err = model.NewLocAppError("SqlChannelStore.Save", CHANNEL_EXISTS_ERROR, nil, "id="+channel.Id+", "+err.Error()) + result.Err = model.NewAppError("SqlChannelStore.Save", CHANNEL_EXISTS_ERROR, nil, "id="+channel.Id+", "+err.Error(), http.StatusBadRequest) result.Data = &dupChannel } } else { @@ -427,7 +428,7 @@ func (s SqlChannelStore) GetChannels(teamId string, userId string) StoreChannel result.Err = model.NewLocAppError("SqlChannelStore.GetChannels", "store.sql_channel.get_channels.get.app_error", nil, "teamId="+teamId+", userId="+userId+", err="+err.Error()) } else { if len(*data) == 0 { - result.Err = model.NewLocAppError("SqlChannelStore.GetChannels", "store.sql_channel.get_channels.not_found.app_error", nil, "teamId="+teamId+", userId="+userId) + result.Err = model.NewAppError("SqlChannelStore.GetChannels", "store.sql_channel.get_channels.not_found.app_error", nil, "teamId="+teamId+", userId="+userId, http.StatusBadRequest) } else { result.Data = data } |