mirror of
https://github.com/GSA/notifications-admin.git
synced 2026-06-16 19:32:58 -04:00
WIP find services by name
This commit is contained in:
@@ -23,6 +23,7 @@ from app.main.forms import (
|
||||
PDFUploadForm,
|
||||
RequiredDateFilterForm,
|
||||
ReturnedLettersForm,
|
||||
SearchByNameForm,
|
||||
)
|
||||
from app.statistics_utils import (
|
||||
get_formatted_percentage,
|
||||
@@ -189,6 +190,23 @@ def platform_admin_services():
|
||||
)
|
||||
|
||||
|
||||
@main.route("/find-services-by-name", methods=['GET', 'POST'])
|
||||
@user_is_platform_admin
|
||||
def find_services_by_name():
|
||||
form = SearchByNameForm()
|
||||
services_found = None
|
||||
status = 200
|
||||
if form.validate_on_submit():
|
||||
services_found = service_api_client.get_service({"name": form.search.data})['data']
|
||||
elif request.method == 'POST':
|
||||
status = 400
|
||||
return render_template(
|
||||
'views/find-services/find-services-by-name.html',
|
||||
form=form,
|
||||
services_found=services_found
|
||||
), status
|
||||
|
||||
|
||||
@main.route("/platform-admin/reports")
|
||||
@user_is_platform_admin
|
||||
def platform_admin_reports():
|
||||
|
||||
Reference in New Issue
Block a user