mirror of
https://github.com/GSA/notifications-api.git
synced 2026-02-04 02:11:11 -05:00
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:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user