Merge pull request #1020 from alphagov/service-notification-by-id

Add private endpoint to get notification by ID
This commit is contained in:
Imdad Ahad
2017-06-07 16:24:47 +01:00
committed by GitHub
2 changed files with 55 additions and 0 deletions

View File

@@ -300,6 +300,19 @@ def get_all_notifications_for_service(service_id):
), 200
@service_blueprint.route('/<uuid:service_id>/notifications/<uuid:notification_id>', methods=['GET'])
def get_notification_for_service(service_id, notification_id):
notification = notifications_dao.get_notification_with_personalisation(
service_id,
notification_id,
key_type=None,
)
return jsonify(
notification_with_template_schema.dump(notification).data,
), 200
def search_for_notification_by_to_field(service_id, search_term, statuses):
results = notifications_dao.dao_get_notifications_by_to_field(service_id, search_term, statuses)
return jsonify(