mirror of
https://github.com/GSA/notifications-api.git
synced 2026-01-31 15:15:38 -05:00
New endpoint to search by "to" field of the notification.
The query ignores case and spaces.
This commit is contained in:
@@ -456,3 +456,10 @@ def dao_update_notifications_sent_to_dvla(job_id, provider):
|
||||
{'status': NOTIFICATION_SENDING, "sent_by": provider, "sent_at": now, "updated_at": now})
|
||||
|
||||
return updated_count
|
||||
|
||||
|
||||
@statsd(namespace="dao")
|
||||
def dao_get_notifications_by_to_field(service_id, search_term):
|
||||
return Notification.query.filter(
|
||||
Notification.service_id == service_id,
|
||||
func.replace(func.lower(Notification.to), " ", "") == search_term.lower().replace(" ", "")).all()
|
||||
|
||||
Reference in New Issue
Block a user