summaryrefslogtreecommitdiffstats
path: root/store/sql_preference_store.go
diff options
context:
space:
mode:
authorJoram Wilander <jwawilander@gmail.com>2017-01-25 09:32:42 -0500
committerHarrison Healey <harrisonmhealey@gmail.com>2017-01-25 09:32:42 -0500
commitd245b29f82a03f1aff966a2fb2100a5703d82f32 (patch)
treecf204039af74fa2579e0291e9e595f08411b0a7a /store/sql_preference_store.go
parent8ed665cb76c0763e83a2949c4bdd70153baf72f7 (diff)
downloadchat-d245b29f82a03f1aff966a2fb2100a5703d82f32.tar.gz
chat-d245b29f82a03f1aff966a2fb2100a5703d82f32.tar.bz2
chat-d245b29f82a03f1aff966a2fb2100a5703d82f32.zip
More app code migration (#5170)
* Migrate admin functions into app package * More user function refactoring * Move post functions into app package
Diffstat (limited to 'store/sql_preference_store.go')
-rw-r--r--store/sql_preference_store.go22
1 files changed, 22 insertions, 0 deletions
diff --git a/store/sql_preference_store.go b/store/sql_preference_store.go
index 5c46d1328..14a9ff48b 100644
--- a/store/sql_preference_store.go
+++ b/store/sql_preference_store.go
@@ -348,3 +348,25 @@ func (s SqlPreferenceStore) DeleteCategory(userId string, category string) Store
return storeChannel
}
+
+func (s SqlPreferenceStore) DeleteCategoryAndName(category string, name string) StoreChannel {
+ storeChannel := make(StoreChannel, 1)
+
+ go func() {
+ result := StoreResult{}
+
+ if _, err := s.GetMaster().Exec(
+ `DELETE FROM
+ Preferences
+ WHERE
+ Name = :Name
+ AND Category = :Category`, map[string]interface{}{"Name": name, "Category": category}); err != nil {
+ result.Err = model.NewLocAppError("SqlPreferenceStore.DeleteCategoryAndName", "store.sql_preference.delete.app_error", nil, err.Error())
+ }
+
+ storeChannel <- result
+ close(storeChannel)
+ }()
+
+ return storeChannel
+}