mirror of
https://github.com/GSA/notifications-api.git
synced 2026-02-03 01:41:05 -05:00
Add DAO function and endpoint for archiving email reply_to addresses
Added a new DAO function which archives email reply_to addresses by setting archived to True. This raises a new type of error, an ArchiveValidationError, if trying to archive a default reply_to address. Added a new endpoint for archiving email reply_to addresses.
This commit is contained in:
@@ -52,6 +52,7 @@ from app.dao.service_whitelist_dao import (
|
||||
)
|
||||
from app.dao.service_email_reply_to_dao import (
|
||||
add_reply_to_email_address_for_service,
|
||||
archive_reply_to_email_address,
|
||||
dao_get_reply_to_by_id,
|
||||
dao_get_reply_to_by_service_id,
|
||||
update_reply_to_email_address
|
||||
@@ -594,6 +595,13 @@ 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>/email-reply-to/<uuid:reply_to_email_id>/archive', methods=['POST'])
|
||||
def delete_service_reply_to_email_address(service_id, reply_to_email_id):
|
||||
archived_reply_to = archive_reply_to_email_address(service_id, reply_to_email_id)
|
||||
|
||||
return jsonify(data=archived_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)
|
||||
|
||||
Reference in New Issue
Block a user