resourcerer 1.0.1 → 1.0.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/model.js +1 -4
- package/package.json +1 -1
- package/test/model.test.js +1 -1
package/lib/model.js
CHANGED
|
@@ -240,10 +240,7 @@ export default class Model {
|
|
|
240
240
|
if (!options.wait) {
|
|
241
241
|
this.set(attrs, options);
|
|
242
242
|
} else {
|
|
243
|
-
|
|
244
|
-
// be associated with an update. this is so that in the sync method, they can get all
|
|
245
|
-
// attributes via .toJSON()
|
|
246
|
-
this.attributes = {...this.attributes, ...attrs};
|
|
243
|
+
options.attrs = {...this.attributes, ...attrs};
|
|
247
244
|
}
|
|
248
245
|
|
|
249
246
|
options.method = this.isNew() ? 'POST' : options.patch ? 'PATCH' : 'PUT';
|
package/package.json
CHANGED
package/test/model.test.js
CHANGED
|
@@ -314,7 +314,7 @@ describe('Model', () => {
|
|
|
314
314
|
|
|
315
315
|
result = model.save({three: 'three'}, {wait: true});
|
|
316
316
|
expect(callback).not.toHaveBeenCalled();
|
|
317
|
-
expect(model.toJSON()).toEqual({one: 'one'
|
|
317
|
+
expect(model.toJSON()).toEqual({one: 'one'});
|
|
318
318
|
|
|
319
319
|
await result;
|
|
320
320
|
|