- Get all jobs for service doesn't return the statistics.
- Dashboard therefore is incorrect

This is the API fix for this, returns the data.
This commit is contained in:
Martyn Inglis
2016-08-26 15:07:59 +01:00
parent 5c0185704e
commit dd7850b235
2 changed files with 54 additions and 3 deletions

View File

@@ -91,6 +91,11 @@ def get_jobs_by_service(service_id):
jobs = dao_get_jobs_by_service_id(service_id, limit_days)
data = job_schema.dump(jobs, many=True).data
for job_data in data:
statistics = dao_get_notification_outcomes_for_job(service_id, job_data['id'])
job_data['statistics'] = [{'status': statistic[1], 'count': statistic[0]} for statistic in statistics]
return jsonify(data=data)