mirror of
https://github.com/GSA/notifications-api.git
synced 2026-02-05 02:41:14 -05:00
add delete functions for inbound and callback api objects
Both service api tasks work fine if the object is unexpectedly deleted halfway through - they both check to see if the api details are still in the DB before trying to send the request.
This commit is contained in:
@@ -32,3 +32,8 @@ def get_service_callback_api(service_callback_api_id, service_id):
|
||||
|
||||
def get_service_callback_api_for_service(service_id):
|
||||
return ServiceCallbackApi.query.filter_by(service_id=service_id).first()
|
||||
|
||||
|
||||
@transactional
|
||||
def delete_service_callback_api(service_callback_api):
|
||||
db.session.delete(service_callback_api)
|
||||
|
||||
@@ -33,3 +33,8 @@ def get_service_inbound_api(service_inbound_api_id, service_id):
|
||||
|
||||
def get_service_inbound_api_for_service(service_id):
|
||||
return ServiceInboundApi.query.filter_by(service_id=service_id).first()
|
||||
|
||||
|
||||
@transactional
|
||||
def delete_service_inbound_api(service_inbound_api):
|
||||
db.session.delete(service_inbound_api)
|
||||
|
||||
Reference in New Issue
Block a user