Skip to content

Commit 21956a5

Browse files
author
Lee Richmond
committed
Move to new response payload
1 parent 99cdc50 commit 21956a5

File tree

2 files changed

+1
-3
lines changed

2 files changed

+1
-3
lines changed

src/util/deserialize.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,7 @@ class Deserializer {
5555

5656
deserializeInstance(instance: Model, resource: japiResource) : Model {
5757
instance.id = resource.id;
58+
instance.temp_id = resource['temp-id'];
5859
this._models.push(instance);
5960

6061
instance.attributes = resource.attributes;
@@ -94,7 +95,6 @@ class Deserializer {
9495
if (Array.isArray(relationData)) {
9596
for (let datum of relationData) {
9697
let relatedRecord = this.deserialize(datum, true);
97-
relatedRecord.temp_id = datum['temp-id'];
9898
this._pushRelationship(instance, relationName, relatedRecord)
9999
relatedRecord.temp_id = null;
100100
}

test/integration/nested-persistence-test.ts

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -144,7 +144,6 @@ describe('nested persistence', function() {
144144
relationships: {
145145
books: {
146146
data: [{
147-
['temp-id']: 'abc1',
148147
id: '10',
149148
type: 'books'
150149
}]
@@ -160,7 +159,6 @@ describe('nested persistence', function() {
160159
relationships: {
161160
genre: {
162161
data: {
163-
['temp-id']: 'abc2',
164162
id: '20',
165163
type: 'genres'
166164
}

0 commit comments

Comments
 (0)