chore: tweak variable names

This commit is contained in:
Steven
2023-12-18 20:47:29 +08:00
parent 16fb5faebd
commit d8a0528135
4 changed files with 18 additions and 19 deletions

View File

@@ -51,12 +51,12 @@ func (d *DB) ListMemos(ctx context.Context, find *store.FindMemo) ([]*store.Memo
}
}
if v := find.VisibilityList; len(v) != 0 {
list := []string{}
placeholder := []string{}
for _, visibility := range v {
list = append(list, fmt.Sprintf("$%d", len(args)+1))
args = append(args, visibility)
placeholder = append(placeholder, "?")
args = append(args, visibility.String())
}
where = append(where, fmt.Sprintf("memo.visibility in (%s)", strings.Join(list, ",")))
where = append(where, fmt.Sprintf("memo.visibility in (%s)", strings.Join(placeholder, ",")))
}
if v := find.Pinned; v != nil {
where = append(where, "memo_organizer.pinned = 1")