From 259e396365f94c1cd184a65c1680a69ca7e27fa7 Mon Sep 17 00:00:00 2001 From: Christian Date: Tue, 14 Feb 2017 09:38:59 +0100 Subject: [PATCH] Fix extractId called after extractAttributes (#47) --- addon/mixin.js | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/addon/mixin.js b/addon/mixin.js index f572fbb..832553a 100644 --- a/addon/mixin.js +++ b/addon/mixin.js @@ -135,11 +135,12 @@ export default Ember.Mixin.create({ let data; if (payload) { - const attributes = this.extractAttributes(primaryModelClass, payload), + const id = this.extractId(primaryModelClass, payload), + attributes = this.extractAttributes(primaryModelClass, payload), relationships = this.extractRelationships(primaryModelClass, payload, included); data = { - id: this.extractId(primaryModelClass, payload), + id, type: primaryModelClass.modelName }; if (Object.keys(attributes).length > 0) {