summaryrefslogtreecommitdiffstats
path: root/store/sql_preference_store.go
diff options
context:
space:
mode:
authorhmhealey <harrisonmhealey@gmail.com>2015-10-13 15:18:01 -0400
committerhmhealey <harrisonmhealey@gmail.com>2015-10-13 15:36:58 -0400
commit97b2f6ffe7fa09a2188163740865322582b00b59 (patch)
tree69c11911d8c364b8d6bb31c2723a8f046b8b61e3 /store/sql_preference_store.go
parent2a39e8dbfab8506b09d0d030f87cac4c079b975a (diff)
downloadchat-97b2f6ffe7fa09a2188163740865322582b00b59.tar.gz
chat-97b2f6ffe7fa09a2188163740865322582b00b59.tar.bz2
chat-97b2f6ffe7fa09a2188163740865322582b00b59.zip
Made further changes based on feedback
Diffstat (limited to 'store/sql_preference_store.go')
-rw-r--r--store/sql_preference_store.go8
1 files changed, 4 insertions, 4 deletions
diff --git a/store/sql_preference_store.go b/store/sql_preference_store.go
index 59c52d888..46cef38b1 100644
--- a/store/sql_preference_store.go
+++ b/store/sql_preference_store.go
@@ -162,9 +162,9 @@ func (s SqlPreferenceStore) Get(userId string, category string, name string) Sto
go func() {
result := StoreResult{}
- var preferences model.Preferences
+ var preference model.Preference
- if _, err := s.GetReplica().Select(&preferences,
+ if err := s.GetReplica().SelectOne(&preference,
`SELECT
*
FROM
@@ -173,9 +173,9 @@ func (s SqlPreferenceStore) Get(userId string, category string, name string) Sto
UserId = :UserId
AND Category = :Category
AND Name = :Name`, map[string]interface{}{"UserId": userId, "Category": category, "Name": name}); err != nil {
- result.Err = model.NewAppError("SqlPreferenceStore.GetByName", "We encounted an error while finding preferences", err.Error())
+ result.Err = model.NewAppError("SqlPreferenceStore.Get", "We encounted an error while finding preferences", err.Error())
} else {
- result.Data = preferences[0]
+ result.Data = preference
}
storeChannel <- result