APIv4: NewLocAppError -> NewAppError (#7328)

Этот коммит содержится в:
George Goldberg
2017-08-31 15:03:16 +01:00
коммит произвёл Joram Wilander
родитель b37e17c032
Коммит 63b10be020
9 изменённых файлов: 34 добавлений и 68 удалений

Просмотреть файл

@@ -106,15 +106,13 @@ func updateChannel(c *Context, w http.ResponseWriter, r *http.Request) {
}
if oldChannel.DeleteAt > 0 {
c.Err = model.NewLocAppError("updateChannel", "api.channel.update_channel.deleted.app_error", nil, "")
c.Err.StatusCode = http.StatusBadRequest
c.Err = model.NewAppError("updateChannel", "api.channel.update_channel.deleted.app_error", nil, "", http.StatusBadRequest)
return
}
if oldChannel.Name == model.DEFAULT_CHANNEL {
if (len(channel.Name) > 0 && channel.Name != oldChannel.Name) || (len(channel.Type) > 0 && channel.Type != oldChannel.Type) {
c.Err = model.NewLocAppError("updateChannel", "api.channel.update_channel.tried.app_error", map[string]interface{}{"Channel": model.DEFAULT_CHANNEL}, "")
c.Err.StatusCode = http.StatusBadRequest
c.Err = model.NewAppError("updateChannel", "api.channel.update_channel.tried.app_error", map[string]interface{}{"Channel": model.DEFAULT_CHANNEL}, "", http.StatusBadRequest)
return
}
}