mirror of
https://github.com/GSA/notifications-api.git
synced 2026-02-04 02:11:11 -05:00
New table and endpoints for service contact lists.
- Table to store meta data for the emergency contact list for a service. - Endpoint for fetching contact lists for service - Endpoint for saving contact list for service. The list will be stored in S3. The service will then be able to send emergency announcements to staff.
This commit is contained in:
16
app/dao/service_contact_list_dao.py
Normal file
16
app/dao/service_contact_list_dao.py
Normal file
@@ -0,0 +1,16 @@
|
||||
from app import db
|
||||
from app.models import ServiceContactList
|
||||
|
||||
|
||||
def dao_get_contact_lists(service_id):
|
||||
contact_lists = ServiceContactList.query.filter_by(
|
||||
service_id=service_id
|
||||
).order_by(
|
||||
ServiceContactList.created_at.desc()
|
||||
)
|
||||
return contact_lists.all()
|
||||
|
||||
|
||||
def save_service_contact_list(service_contact_list):
|
||||
db.session.add(service_contact_list)
|
||||
db.session.commit()
|
||||
Reference in New Issue
Block a user