mirror of
https://github.com/GSA/notifications-api.git
synced 2026-02-03 01:41:05 -05:00
add GET/POST rest endpoints for whitelist
GET /<service_id>/whitelist
returns all whitelisted contacts for a service, separated into two lists
POST /<service_id>/whitelist
removes all existing whitelisted contacts, and replaces them with the
provided new entries
(todo: dao work + tests)
This commit is contained in:
11
app/dao/service_whitelist_dao.py
Normal file
11
app/dao/service_whitelist_dao.py
Normal file
@@ -0,0 +1,11 @@
|
||||
from sqlalchemy import or_
|
||||
|
||||
from app import db
|
||||
from app.models import ServiceWhitelist
|
||||
|
||||
def dao_fetch_service_whitelist(service_id):
|
||||
return ServiceWhitelist.query().filter(ServiceWhitelist.service_id == service_id).all()
|
||||
|
||||
|
||||
def dao_add_whitelisted_contact(obj):
|
||||
db.session.add(obj)
|
||||
Reference in New Issue
Block a user