Skip to content

Commit ec04ea1

Browse files
committed
Add filtering for critical and funding parameters to names endpoint
1 parent 43f676d commit ec04ea1

File tree

2 files changed

+14
-0
lines changed

2 files changed

+14
-0
lines changed

app/controllers/api/v1/packages_controller.rb

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -127,6 +127,8 @@ def names
127127
scope = scope.updated_after(params[:updated_after]) if params[:updated_after].present?
128128
scope = scope.created_before(params[:created_before]) if params[:created_before].present?
129129
scope = scope.updated_before(params[:updated_before]) if params[:updated_before].present?
130+
scope = scope.critical if params[:critical].present?
131+
scope = scope.with_funding if params[:funding].present?
130132

131133
if params[:sort].present? || params[:order].present?
132134
sort = params[:sort] || 'updated_at'

openapi/api/v1/openapi.yaml

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -617,6 +617,18 @@ paths:
617617
required: false
618618
schema:
619619
type: string
620+
- name: critical
621+
in: query
622+
description: filter by critical packages
623+
required: false
624+
schema:
625+
type: boolean
626+
- name: funding
627+
in: query
628+
description: filter by packages with funding information
629+
required: false
630+
schema:
631+
type: boolean
620632
responses:
621633
200:
622634
description: OK

0 commit comments

Comments
 (0)