Add custom branding functionality (#2667)
Этот коммит содержится в:
коммит произвёл
Christopher Speller
родитель
5b96ad59c5
Коммит
49ab8b2161
@@ -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
|
||||
}
|
||||
|
||||
@@ -30,6 +30,12 @@ func TestSqlSystemStore(t *testing.T) {
|
||||
if systems2[system.Name] != system.Value {
|
||||
t.Fatal()
|
||||
}
|
||||
|
||||
result3 := <-store.System().GetByName(system.Name)
|
||||
rsystem := result3.Data.(*model.System)
|
||||
if rsystem.Value != system.Value {
|
||||
t.Fatal()
|
||||
}
|
||||
}
|
||||
|
||||
func TestSqlSystemStoreSaveOrUpdate(t *testing.T) {
|
||||
|
||||
@@ -184,6 +184,7 @@ type SystemStore interface {
|
||||
SaveOrUpdate(system *model.System) StoreChannel
|
||||
Update(system *model.System) StoreChannel
|
||||
Get() StoreChannel
|
||||
GetByName(name string) StoreChannel
|
||||
}
|
||||
|
||||
type WebhookStore interface {
|
||||
|
||||
Ссылка в новой задаче
Block a user