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

@@ -179,8 +179,8 @@ def get_notifications_for_job(service_id, job_id, filter_dict=None, page=1, page
@statsd(namespace="dao")
def dao_get_notification_count_for_job_id(*, service_id, job_id):
return Notification.query.filter_by(service_id=service_id, job_id=job_id).count()
def dao_get_notification_count_for_job_id(*, job_id):
return Notification.query.filter_by(job_id=job_id).count()
@statsd(namespace="dao")