summaryrefslogtreecommitdiffstats
path: root/model/client.go
diff options
context:
space:
mode:
authorHarrison Healey <harrisonmhealey@gmail.com>2016-07-14 10:08:36 -0400
committerChristopher Speller <crspeller@gmail.com>2016-07-14 10:08:36 -0400
commitcaabfbcdd56bdced7c5c1d38e00f488adffe7c60 (patch)
tree4d52326767246f331da352f0427e34bf714e3130 /model/client.go
parent8e810bc2ebb743717b5b0fc4541fcd3b2565966c (diff)
downloadchat-caabfbcdd56bdced7c5c1d38e00f488adffe7c60.tar.gz
chat-caabfbcdd56bdced7c5c1d38e00f488adffe7c60.tar.bz2
chat-caabfbcdd56bdced7c5c1d38e00f488adffe7c60.zip
PLT-2992 Added the ability to use different themes for each team (#3411)
* Cleaned up user_settings_theme.jsx and import_theme_modal.jsx * Made ImportThemeModal use a callback to return the theme to the user settings modal instead of saving it directly * Moved user theme from model to preferences * Added serverside API to delete preferences TODO update package with client stuff * Changed constants.jsx so that Preferences and ActionTypes can be imported on their own * Updated ThemeProps migration code to properly rename solarized code themes * Fixed warnings thrown by AppDispatcher * Added clientside UI to support team-specific themes * Removed debugging code from test * Fixed setting a user's theme when they haven't set their theme before
Diffstat (limited to 'model/client.go')
-rw-r--r--model/client.go10
1 files changed, 10 insertions, 0 deletions
diff --git a/model/client.go b/model/client.go
index 5ccf2c63c..e12cd595d 100644
--- a/model/client.go
+++ b/model/client.go
@@ -1556,6 +1556,16 @@ func (c *Client) GetPreferenceCategory(category string) (*Result, *AppError) {
}
}
+// DeletePreferences deletes a list of preferences owned by the current user. If successful,
+// it will return status=ok. Otherwise, an error will be returned.
+func (c *Client) DeletePreferences(preferences *Preferences) (bool, *AppError) {
+ if r, err := c.DoApiPost("/preferences/delete", preferences.ToJson()); err != nil {
+ return false, err
+ } else {
+ return c.CheckStatusOK(r), nil
+ }
+}
+
func (c *Client) CreateOutgoingWebhook(hook *OutgoingWebhook) (*Result, *AppError) {
if r, err := c.DoApiPost(c.GetTeamRoute()+"/hooks/outgoing/create", hook.ToJson()); err != nil {
return nil, err