Skip to content

Commit 2c6a513

Browse files
committed
Revert "feat: respect only"
This reverts commit a279ef9.
1 parent 74feaa0 commit 2c6a513

2 files changed

Lines changed: 0 additions & 28 deletions

File tree

graphql2/graphqlapp/service.go

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -54,9 +54,6 @@ func (q *Query) Services(ctx context.Context, opts *graphql2.ServiceSearchOption
5454
searchOpts.FavoritesFirst = *opts.FavoritesFirst
5555
}
5656
searchOpts.Omit = opts.Omit
57-
if len(opts.Only) > 0 {
58-
searchOpts.Only = opts.Only
59-
}
6057
if opts.After != nil && *opts.After != "" {
6158
err = search.ParseCursor(*opts.After, &searchOpts)
6259
if err != nil {

service/search.go

Lines changed: 0 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -28,9 +28,6 @@ type SearchOptions struct {
2828
// Omit specifies a list of service IDs to exclude from the results.
2929
Omit []string `json:"m,omitempty"`
3030

31-
// Only lookup the service IDs present in the request.
32-
Only []string `json:"only,omitempty"`
33-
3431
// FavoritesFirst indicates that services marked as favorite (by FavoritesUserID) should be returned first (before any non-favorites).
3532
FavoritesFirst bool `json:"f,omitempty"`
3633

@@ -209,28 +206,6 @@ func (s *Store) Search(ctx context.Context, opts *SearchOptions) ([]Service, err
209206
opts = &SearchOptions{}
210207
}
211208

212-
if len(opts.Only) > 0 {
213-
query := `SELECT id, name, description, escalation_policy_id, false, maintenance_expires_at
214-
FROM services WHERE id = ANY($1::uuid[])`
215-
rows, err := s.db.QueryContext(ctx, query, sqlutil.UUIDArray(opts.Only))
216-
if err != nil {
217-
return nil, err
218-
}
219-
defer rows.Close()
220-
var result []Service
221-
for rows.Next() {
222-
var s Service
223-
var maintExpiresAt sql.NullTime
224-
err = rows.Scan(&s.ID, &s.Name, &s.Description, &s.EscalationPolicyID, &s.isUserFavorite, &maintExpiresAt)
225-
if err != nil {
226-
return nil, err
227-
}
228-
s.MaintenanceExpiresAt = maintExpiresAt.Time
229-
result = append(result, s)
230-
}
231-
return result, nil
232-
}
233-
234209
userCheck := permission.User
235210
if opts.FavoritesUserID != "" {
236211
userCheck = permission.MatchUser(opts.FavoritesUserID)

0 commit comments

Comments
 (0)