mirror of
https://github.com/GSA/notifications-api.git
synced 2026-09-11 10:28:55 -04:00
Add get letter contact by id endpoint
Added the GET /<uuid:service_id>/letter-contact/<uuid:letter_contact_id> endpoint for returning a letter contact for a service with the letter contact id Added the DAO for returning a letter contact by id
This commit is contained in:
@@ -19,6 +19,16 @@ def dao_get_letter_contacts_by_service_id(service_id):
|
||||
return letter_contacts
|
||||
|
||||
|
||||
def dao_get_letter_contact_by_id(service_id, letter_contact_id):
|
||||
letter_contact = db.session.query(
|
||||
ServiceLetterContact
|
||||
).filter(
|
||||
ServiceLetterContact.service_id == service_id,
|
||||
ServiceLetterContact.id == letter_contact_id
|
||||
).one()
|
||||
return letter_contact
|
||||
|
||||
|
||||
def create_or_update_letter_contact(service_id, contact_block):
|
||||
letter_contacts = dao_get_letter_contacts_by_service_id(service_id)
|
||||
if len(letter_contacts) == 0:
|
||||
|
||||
Reference in New Issue
Block a user