Remove unused methods.

A new endpoint to return the last date a template was used which means the old endpoint can be removed.
This commit is contained in:
Rebecca Law
2020-02-07 15:50:54 +00:00
parent 9cd433349c
commit 8445775be0
5 changed files with 4 additions and 143 deletions

View File

@@ -1,11 +1,10 @@
from flask import Blueprint, jsonify, request
from app import DATETIME_FORMAT
from app.dao.notifications_dao import dao_get_last_template_usage, dao_get_last_date_template_was_used
from app.dao.notifications_dao import dao_get_last_date_template_was_used
from app.dao.templates_dao import dao_get_template_by_id_and_service_id
from app.dao.fact_notification_status_dao import fetch_notification_status_for_service_for_today_and_7_previous_days
from app.schemas import notification_with_template_schema
from app.errors import register_errors, InvalidRequest
template_statistics = Blueprint('template_statistics',
@@ -44,18 +43,6 @@ def get_template_statistics_for_service_by_day(service_id):
])
@template_statistics.route('/<template_id>')
def get_template_statistics_for_template_id(service_id, template_id):
template = dao_get_template_by_id_and_service_id(template_id, service_id)
data = None
notification = dao_get_last_template_usage(template_id, template.template_type, template.service_id)
if notification:
data = notification_with_template_schema.dump(notification).data
return jsonify(data=data)
@template_statistics.route('/last-used/<uuid:template_id>')
def get_last_used_datetime_for_template(service_id, template_id):
# Check the template and service exist