Comparing version 0.0.9 to 0.0.10
@@ -105,2 +105,3 @@ 'use strict'; | ||
var originalAttributes = this.attributes.toJS(); | ||
if (!this.get('id')) { | ||
@@ -113,3 +114,5 @@ return this.collection.create(attributes, { optimistic: optimistic }); | ||
if (patch) { | ||
data = Object.assign({}, this.attributes.toJS(), attributes); | ||
data = Object.assign({}, originalAttributes, attributes); | ||
} else { | ||
data = attributes; | ||
} | ||
@@ -116,0 +119,0 @@ |
{ | ||
"name": "mobx-rest", | ||
"version": "0.0.9", | ||
"version": "0.0.10", | ||
"description": "REST conventions for mobx.", | ||
@@ -5,0 +5,0 @@ "repository": { |
@@ -74,3 +74,3 @@ /*global describe, it, context, beforeEach*/ | ||
it('it sets model straight away', () => { | ||
model.save({id: item.id, name}, {patch: false}) | ||
model.save({name}, {patch: false}) | ||
assert.equal(model.get('name'), 'dylan') | ||
@@ -77,0 +77,0 @@ assert.equal(model.get('album'), null) |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
38373
881