add template_statistics endpoint for specific template

`/service/<service_id>/template-statistics/<template_id>`
still requires service-id just to try and keep api tree cleaner
This commit is contained in:
Leo Hemsted
2016-06-07 14:18:42 +01:00
parent 73004a0f74
commit e3d9dfad6e
3 changed files with 116 additions and 2 deletions

View File

@@ -139,6 +139,12 @@ def dao_get_template_statistics_for_service(service_id, limit_days=None):
desc(TemplateStatistics.updated_at)).all()
def dao_get_template_statistics_for_template(template_id):
return TemplateStatistics.query.filter(
TemplateStatistics.template_id == template_id
).all()
@transactional
def dao_create_notification(notification, notification_type, provider_identifier):
provider = ProviderDetails.query.filter_by(identifier=provider_identifier).one()