diff options
author | Joram Wilander <jwawilander@gmail.com> | 2016-04-11 13:45:03 -0400 |
---|---|---|
committer | Christopher Speller <crspeller@gmail.com> | 2016-04-11 13:45:03 -0400 |
commit | 49ab8b216191749bd39694d79f687a84ad24adf0 (patch) | |
tree | 27b4966d437b15ddcd8d420b8a1afc1881455c13 /store/sql_system_store.go | |
parent | 5b96ad59c502d435dbca95950c4590a575b2c5b9 (diff) | |
download | chat-49ab8b216191749bd39694d79f687a84ad24adf0.tar.gz chat-49ab8b216191749bd39694d79f687a84ad24adf0.tar.bz2 chat-49ab8b216191749bd39694d79f687a84ad24adf0.zip |
Add custom branding functionality (#2667)
Diffstat (limited to 'store/sql_system_store.go')
-rw-r--r-- | store/sql_system_store.go | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/store/sql_system_store.go b/store/sql_system_store.go index f8da06cec..a2b4f6396 100644 --- a/store/sql_system_store.go +++ b/store/sql_system_store.go @@ -114,3 +114,24 @@ func (s SqlSystemStore) Get() StoreChannel { return storeChannel } + +func (s SqlSystemStore) GetByName(name string) StoreChannel { + + storeChannel := make(StoreChannel) + + go func() { + result := StoreResult{} + + var system model.System + if err := s.GetReplica().SelectOne(&system, "SELECT * FROM Systems WHERE Name = :Name", map[string]interface{}{"Name": name}); err != nil { + result.Err = model.NewLocAppError("SqlSystemStore.GetByName", "store.sql_system.get_by_name.app_error", nil, "") + } + + result.Data = &system + + storeChannel <- result + close(storeChannel) + }() + + return storeChannel +} |