mirror of
https://github.com/GSA/notifications-api.git
synced 2026-08-19 05:58:53 -04:00
Add endpoint to return all letter contact blocks
Added the GET '/<uuid:service_id>/letter-contact' endpoint for returning all letter contact blocks for a service. Updated the DAO for service letter contacts to return the default letter contact first.
This commit is contained in:
@@ -1,3 +1,5 @@
|
||||
from sqlalchemy import desc
|
||||
|
||||
from app import db
|
||||
from app.dao.dao_utils import transactional
|
||||
from app.errors import InvalidRequest
|
||||
@@ -10,7 +12,8 @@ def dao_get_letter_contacts_by_service_id(service_id):
|
||||
).filter(
|
||||
ServiceLetterContact.service_id == service_id
|
||||
).order_by(
|
||||
ServiceLetterContact.created_at
|
||||
desc(ServiceLetterContact.is_default),
|
||||
desc(ServiceLetterContact.created_at)
|
||||
).all()
|
||||
|
||||
return letter_contacts
|
||||
|
||||
Reference in New Issue
Block a user