From 609d4f43d9eef504d852fbf02af5473b0d1424c8 Mon Sep 17 00:00:00 2001 From: Joram Wilander Date: Thu, 2 Feb 2017 09:04:36 -0500 Subject: Implement POST /channels endpoint for APIv4 (#5241) --- store/sql_channel_store.go | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'store') 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 } -- cgit v1.2.3-1-g7c22