mirror of
https://github.com/GSA/notifications-api.git
synced 2026-01-31 23:26:23 -05:00
add only_active flag to GET /services/
does what it says on the tin
This commit is contained in:
@@ -28,12 +28,17 @@ from app.models import (
|
||||
from app.statsd_decorators import statsd
|
||||
|
||||
|
||||
def dao_fetch_all_services():
|
||||
return Service.query.order_by(
|
||||
def dao_fetch_all_services(only_active=False):
|
||||
query = Service.query.order_by(
|
||||
asc(Service.created_at)
|
||||
).options(
|
||||
joinedload('users')
|
||||
).all()
|
||||
)
|
||||
|
||||
if only_active:
|
||||
query = query.filter(Service.active)
|
||||
|
||||
return query.all()
|
||||
|
||||
|
||||
def dao_fetch_service_by_id(service_id):
|
||||
|
||||
Reference in New Issue
Block a user