henrybuilt-js-library
Advanced tools
Comparing version 1.6.10 to 1.6.11
{ | ||
"name": "henrybuilt-js-library", | ||
"version": "1.6.10", | ||
"version": "1.6.11", | ||
"description": "", | ||
@@ -5,0 +5,0 @@ "main": "index.js", |
@@ -134,15 +134,14 @@ var libString = require('@src/string'); | ||
var changedProps = _.pickBy(this.props.resourceProps, (newValue, key) => { | ||
var propsToUpdate = _.pickBy(this.props.resourceProps, (newValue, key) => { | ||
var cachedValue = this.cachedResourcePropsForUpdate[key]; | ||
return !_.isEqual(cachedValue, newValue); | ||
return key !== 'id' && !_.isEqual(cachedValue, newValue); | ||
}); | ||
//TODO make sure update goes through eventually if isCreating | ||
if (this.exists && _.size(changedProps) > 0) { | ||
if (this.exists && _.size(propsToUpdate) > 0) { | ||
this.cacheResourceProps({forUpdate: true}); | ||
await makeApiBatchRequest({resourceKey: this.resourceKey, actionKey: 'update', params: { | ||
props: _.omit(changedProps, ['id']), | ||
where: {id: this.id} | ||
props: propsToUpdate, where: {id: this.id} | ||
}}); | ||
@@ -149,0 +148,0 @@ |
@@ -209,3 +209,3 @@ var Class = require('@src/core/class'); | ||
expect(requestBody.resources).to.deep.equal({update: {projects: [{props: {a: 1, b: 2}, where: {id: 1}}]}}); | ||
expect(requestBody.resources).to.deep.equal({update: {projects: [{props: {b: 2}, where: {id: 1}}]}}); | ||
expect(requestCount).to.equal(1); | ||
@@ -212,0 +212,0 @@ }); |
Sorry, the diff of this file is too big to display
644607
5090