fix: [CDE-438]: add markedForDeletion filter in count (#2887)

* add markedForDeletion filter in count
devcontainer-setup
Deepak Bhatt 2024-10-29 05:50:14 +00:00 committed by Harness
parent 6dbe85fbfd
commit 35981e7f02
1 changed files with 4 additions and 1 deletions

View File

@ -117,9 +117,12 @@ func (s gitspaceConfigStore) Count(ctx context.Context, filter *types.GitspaceFi
if filter.UserID != "" { if filter.UserID != "" {
countStmt = countStmt.Where(squirrel.Eq{"gconf_user_uid": filter.UserID}) countStmt = countStmt.Where(squirrel.Eq{"gconf_user_uid": filter.UserID})
} }
if filter.SpaceIDs != nil { if len(filter.SpaceIDs) > 0 {
countStmt = countStmt.Where(squirrel.Eq{"gconf_space_id": filter.SpaceIDs}) countStmt = countStmt.Where(squirrel.Eq{"gconf_space_id": filter.SpaceIDs})
} }
if filter.IncludeMarkedForDeletion {
countStmt = countStmt.Where(squirrel.Eq{"gconf_is_marked_for_deletion": true})
}
sql, args, err := countStmt.ToSql() sql, args, err := countStmt.ToSql()
if err != nil { if err != nil {