Update the new endpoint to return a 404 if the job or service id are not found.

All our endpoint should perform a check that the params are valid - this is an easy whay to check that and is standard for our endpoints.
I reverted the query to just filter by job id.
This commit is contained in:
Rebecca Law
2019-10-03 14:58:49 +01:00
parent c48aa77dd5
commit 7fc7d99dac
4 changed files with 26 additions and 23 deletions

View File

@@ -110,7 +110,8 @@ def get_all_notifications_for_service_job(service_id, job_id):
@job_blueprint.route('/<job_id>/notification_count', methods=['GET'])
def get_notification_count_for_job_id(service_id, job_id):
count = dao_get_notification_count_for_job_id(service_id=service_id, job_id=job_id)
dao_get_job_by_service_id_and_job_id(service_id, job_id)
count = dao_get_notification_count_for_job_id(job_id=job_id)
return jsonify(
count=count
), 200