feat: add resource visibility to user setting (#1190)

This commit is contained in:
boojack
2023-02-27 22:16:33 +08:00
committed by GitHub
parent ae61ade2b1
commit 9577f6dbe8
7 changed files with 100 additions and 17 deletions

View File

@@ -120,8 +120,8 @@ func upsertUserSetting(ctx context.Context, tx *sql.Tx, upsert *api.UserSettingU
func findUserSettingList(ctx context.Context, tx *sql.Tx, find *api.UserSettingFind) ([]*userSettingRaw, error) {
where, args := []string{"1 = 1"}, []interface{}{}
if v := find.Key; v != nil {
where, args = append(where, "key = ?"), append(args, v.String())
if v := find.Key.String(); v != "" {
where, args = append(where, "key = ?"), append(args, v)
}
where, args = append(where, "user_id = ?"), append(args, find.UserID)