chore: add view field into shortcut api

This commit is contained in:
Steven
2023-06-24 16:14:08 +08:00
parent d61c99f95a
commit 19cdea6bca
2 changed files with 23 additions and 2 deletions

View File

@ -60,6 +60,7 @@ type Activity struct {
type FindActivity struct {
Type ActivityType
Level ActivityLevel
Where []string
}
func (s *Store) CreateActivity(ctx context.Context, create *Activity) (*Activity, error) {
@ -142,6 +143,9 @@ func listActivities(ctx context.Context, tx *sql.Tx, find *FindActivity) ([]*Act
if find.Level != "" {
where, args = append(where, "level = ?"), append(args, find.Level.String())
}
if find.Where != nil {
where = append(where, find.Where...)
}
query := `
SELECT