mirror of
https://github.com/GSA/notifications-api.git
synced 2026-08-19 14:08:47 -04:00
Fixed the template uri for the post notification responses.
It was optimistic to think the v2 templates would be complete.
This commit is contained in:
@@ -187,17 +187,19 @@ post_email_response = {
|
||||
}
|
||||
|
||||
|
||||
def create_post_sms_response_from_notification(notification, body, from_number, url_root):
|
||||
def create_post_sms_response_from_notification(notification, body, from_number, url_root, service_id):
|
||||
return {"id": notification.id,
|
||||
"reference": notification.client_reference,
|
||||
"content": {'body': body,
|
||||
'from_number': from_number},
|
||||
"uri": "{}v2/notifications/{}".format(url_root, str(notification.id)),
|
||||
"template": __create_template_from_notification(notification=notification, url_root=url_root)
|
||||
"template": __create_template_from_notification(notification=notification,
|
||||
url_root=url_root,
|
||||
service_id=service_id)
|
||||
}
|
||||
|
||||
|
||||
def create_post_email_response_from_notification(notification, content, subject, email_from, url_root):
|
||||
def create_post_email_response_from_notification(notification, content, subject, email_from, url_root, service_id):
|
||||
return {
|
||||
"id": notification.id,
|
||||
"reference": notification.client_reference,
|
||||
@@ -207,13 +209,15 @@ def create_post_email_response_from_notification(notification, content, subject,
|
||||
"subject": subject
|
||||
},
|
||||
"uri": "{}v2/notifications/{}".format(url_root, str(notification.id)),
|
||||
"template": __create_template_from_notification(notification=notification, url_root=url_root)
|
||||
"template": __create_template_from_notification(notification=notification,
|
||||
url_root=url_root,
|
||||
service_id=service_id)
|
||||
}
|
||||
|
||||
|
||||
def __create_template_from_notification(notification, url_root):
|
||||
def __create_template_from_notification(notification, url_root, service_id):
|
||||
return {
|
||||
"id": notification.template_id,
|
||||
"version": notification.template_version,
|
||||
"uri": "{}v2/templates/{}".format(url_root, str(notification.template_id))
|
||||
"uri": "{}services/{}/templates/{}".format(url_root, str(service_id), str(notification.template_id))
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user