mirror of
https://github.com/GSA/notifications-api.git
synced 2026-01-31 23:26:23 -05:00
Add endpoint to return all letter contact blocks
Added the GET '/<uuid:service_id>/letter-contact' endpoint for returning all letter contact blocks for a service. Updated the DAO for service letter contacts to return the default letter contact first.
This commit is contained in:
@@ -53,7 +53,7 @@ from app.dao.service_email_reply_to_dao import (
|
||||
dao_get_reply_to_by_service_id,
|
||||
update_reply_to_email_address
|
||||
)
|
||||
from app.dao.service_letter_contact_dao import create_or_update_letter_contact
|
||||
from app.dao.service_letter_contact_dao import dao_get_letter_contacts_by_service_id, create_or_update_letter_contact
|
||||
from app.dao.provider_statistics_dao import get_fragment_count
|
||||
from app.dao.users_dao import get_user_by_id
|
||||
from app.errors import (
|
||||
@@ -571,6 +571,12 @@ def update_service_reply_to_email_address(service_id, reply_to_email_id):
|
||||
return jsonify(data=new_reply_to.serialize()), 200
|
||||
|
||||
|
||||
@service_blueprint.route('/<uuid:service_id>/letter-contact', methods=["GET"])
|
||||
def get_letter_contacts(service_id):
|
||||
result = dao_get_letter_contacts_by_service_id(service_id)
|
||||
return jsonify([i.serialize() for i in result]), 200
|
||||
|
||||
|
||||
@service_blueprint.route('/unique', methods=["GET"])
|
||||
def is_service_name_unique():
|
||||
name, email_from = check_request_args(request)
|
||||
|
||||
Reference in New Issue
Block a user