Post endpoint to create notificaition and get endpoint

to retrieve notification by id return data in shape more
consistent with other api endpoints.
This commit is contained in:
Adam Shimali
2016-03-24 13:34:45 +00:00
parent f76af9acb7
commit 7bc81528bb
2 changed files with 8 additions and 6 deletions

View File

@@ -215,7 +215,7 @@ def process_firetext_response():
@notifications.route('/notifications/<uuid:notification_id>', methods=['GET'])
def get_notifications(notification_id):
notification = notifications_dao.get_notification(api_user['client'], notification_id)
return jsonify({'notification': notification_status_schema.dump(notification).data}), 200
return jsonify(data={"notification": notification_status_schema.dump(notification).data}), 200
@notifications.route('/notifications', methods=['GET'])
@@ -380,4 +380,5 @@ def send_notification(notification_type):
encryption.encrypt(notification),
datetime.utcnow().strftime(DATETIME_FORMAT)
), queue='email')
return jsonify({'notification_id': notification_id}), 201
return jsonify(data={"notification": {"id": notification_id}}), 201