From b4bf0f28e84b6ea3fe7737f80ce9abf34944bcd5 Mon Sep 17 00:00:00 2001 From: Alex LaFroscia Date: Wed, 10 Aug 2016 17:46:05 -0700 Subject: [PATCH] Revert changing payload info to `meta` property (#142) Closes #141 --- addon/mixins/ajax-request.js | 4 ++-- tests/unit/mixins/ajax-request-test.js | 6 +++--- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/addon/mixins/ajax-request.js b/addon/mixins/ajax-request.js index e0d08ab1..7ab10e6a 100644 --- a/addon/mixins/ajax-request.js +++ b/addon/mixins/ajax-request.js @@ -830,7 +830,7 @@ export default Mixin.create({ return { status: `${status}`, title: error.title || 'The backend responded with an error', - meta: error + detail: error }; } else { return { @@ -852,7 +852,7 @@ export default Mixin.create({ { status: `${status}`, title: payload.title || 'The backend responded with an error', - meta: payload + detail: payload } ]; } diff --git a/tests/unit/mixins/ajax-request-test.js b/tests/unit/mixins/ajax-request-test.js index 199675f8..53625a26 100644 --- a/tests/unit/mixins/ajax-request-test.js +++ b/tests/unit/mixins/ajax-request-test.js @@ -695,8 +695,8 @@ describe('Unit | Mixin | ajax request', function() { { status: 400, title: 'Bar' } ]); expect(payloadArrayOfObjects).to.deep.equal([ - { status: '400', title: 'Foo', meta: { status: 400, title: 'Foo' } }, - { status: '400', title: 'Bar', meta: { status: 400, title: 'Bar' } } + { status: '400', title: 'Foo', detail: { status: 400, title: 'Foo' } }, + { status: '400', title: 'Bar', detail: { status: 400, title: 'Bar' } } ]); const payloadArrayOfStrings = service.normalizeErrorResponse(400, {}, [ @@ -722,7 +722,7 @@ describe('Unit | Mixin | ajax request', function() { { status: '400', title: 'Foo', - meta: { + detail: { title: 'Foo' } }