Preferences: Fixes broken preferences after recent merge (#48157)

* Preferences: Fixes broken preferences after recent merge

* Added check

* Shorter syntax

* Fixed test

* Remove error, and remove duplicate call
This commit is contained in:
Torkel Ödegaard
2022-04-24 17:50:10 +02:00
committed by GitHub
parent ea52663dd9
commit 70a7b73839
3 changed files with 8 additions and 12 deletions
+1
View File
@@ -30,6 +30,7 @@ func (s *Service) GetWithDefaults(ctx context.Context, query *pref.GetPreference
OrgID: query.OrgID,
UserID: query.UserID,
}
prefs, err := s.store.List(ctx, listQuery)
if err != nil {
return nil, err
@@ -107,7 +107,7 @@ func TestPreferencesService(t *testing.T) {
Theme: "light",
Timezone: "UTC",
}
query := &pref.GetPreferenceWithDefaultsQuery{}
query := &pref.GetPreferenceWithDefaultsQuery{OrgID: 1}
preference, err := prefService.GetWithDefaults(context.Background(), query)
require.NoError(t, err)
expected := &pref.Preference{