mirror of
https://github.com/GSA/notifications-api.git
synced 2026-02-04 02:11:11 -05:00
Endpoint to return a ServiceContactList for a given id.
This commit is contained in:
@@ -36,7 +36,8 @@ from app.dao.returned_letters_dao import (
|
||||
fetch_returned_letter_summary,
|
||||
fetch_returned_letters,
|
||||
)
|
||||
from app.dao.service_contact_list_dao import dao_get_contact_lists, save_service_contact_list
|
||||
from app.dao.service_contact_list_dao import dao_get_contact_lists, save_service_contact_list, \
|
||||
dao_get_contact_list_by_id
|
||||
from app.dao.service_data_retention_dao import (
|
||||
fetch_service_data_retention,
|
||||
fetch_service_data_retention_by_id,
|
||||
@@ -1023,6 +1024,16 @@ def get_contact_list(service_id):
|
||||
return jsonify([x.serialize() for x in contact_lists])
|
||||
|
||||
|
||||
@service_blueprint.route('/<uuid:service_id>/contact-list/<uuid:contact_list_id>', methods=['GET'])
|
||||
def get_contact_list_by_id(service_id, contact_list_id):
|
||||
contact_list = dao_get_contact_list_by_id(
|
||||
service_id=service_id,
|
||||
contact_list_id=contact_list_id
|
||||
)
|
||||
|
||||
return jsonify(contact_list.serialize())
|
||||
|
||||
|
||||
@service_blueprint.route('/<uuid:service_id>/contact-list', methods=['POST'])
|
||||
def create_contact_list(service_id):
|
||||
service_contact_list = validate(request.get_json(), create_service_contact_list_schema)
|
||||
|
||||
Reference in New Issue
Block a user