mirror of
https://github.com/GSA/notifications-api.git
synced 2026-08-14 23:07:49 -04:00
Merge pull request #1400 from alphagov/ken-allow-include_jobs-arg-get_all_notis
Allow include jobs request param on v2 get all notifications
This commit is contained in:
@@ -35,6 +35,9 @@ def get_notifications():
|
||||
if 'reference' in _data:
|
||||
_data['reference'] = _data['reference'][0]
|
||||
|
||||
if 'include_jobs' in _data:
|
||||
_data['include_jobs'] = _data['include_jobs'][0]
|
||||
|
||||
data = validate(_data, get_notifications_request)
|
||||
|
||||
paginated_notifications = notifications_dao.get_notifications_for_service(
|
||||
@@ -44,7 +47,8 @@ def get_notifications():
|
||||
personalisation=True,
|
||||
older_than=data.get('older_than'),
|
||||
client_reference=data.get('reference'),
|
||||
page_size=current_app.config.get('API_PAGE_SIZE')
|
||||
page_size=current_app.config.get('API_PAGE_SIZE'),
|
||||
include_jobs=data.get('include_jobs')
|
||||
)
|
||||
|
||||
def _build_links(notifications):
|
||||
|
||||
@@ -74,6 +74,7 @@ get_notifications_request = {
|
||||
"enum": TEMPLATE_TYPES
|
||||
}
|
||||
},
|
||||
"include_jobs": {"enum": ["true", "True"]},
|
||||
"older_than": uuid
|
||||
},
|
||||
"additionalProperties": False,
|
||||
@@ -88,7 +89,7 @@ get_notifications_response = {
|
||||
"type": "array",
|
||||
"items": {
|
||||
"type": "object",
|
||||
"ref": get_notification_response
|
||||
"$ref": "#/definitions/notification"
|
||||
}
|
||||
},
|
||||
"links": {
|
||||
@@ -106,7 +107,11 @@ get_notifications_response = {
|
||||
}
|
||||
},
|
||||
"additionalProperties": False,
|
||||
"required": ["notifications", "links"]
|
||||
"required": ["notifications", "links"],
|
||||
"definitions": {
|
||||
"notification": get_notification_response
|
||||
},
|
||||
|
||||
}
|
||||
|
||||
post_sms_request = {
|
||||
|
||||
Reference in New Issue
Block a user