diff --git a/src/common/module.js b/src/common/module.js index a45b4006b..4db7cefd0 100644 --- a/src/common/module.js +++ b/src/common/module.js @@ -1,5 +1,5 @@ import { isString, isElement } from 'underscore'; -import { createId } from 'utils/mixins'; +import { createId, isDef } from 'utils/mixins'; export default { getConfig(name) { @@ -33,7 +33,7 @@ export default { if (onResult) { result && onResult(result, opts); - } else if (result && result.length) { + } else if (result && isDef(result.length)) { coll.reset(result, opts); } diff --git a/src/css_composer/model/CssRule.js b/src/css_composer/model/CssRule.js index 0ec25000b..cc5153e48 100644 --- a/src/css_composer/model/CssRule.js +++ b/src/css_composer/model/CssRule.js @@ -234,6 +234,9 @@ export default class CssRule extends Model.extend(Styleable) { } }); + // Delete the property used for partial updates + delete obj.style.__p; + if (isEmpty(obj.selectors)) delete obj.selectors; if (isEmpty(obj.style)) delete obj.style; } diff --git a/src/storage_manager/config/config.js b/src/storage_manager/config/config.js index ec105ca70..6c01ac52f 100644 --- a/src/storage_manager/config/config.js +++ b/src/storage_manager/config/config.js @@ -52,7 +52,7 @@ export default { // You can pass a simple object: { someOption: 'someValue' } // or a function which returns and object to add: // currentOpts => { - // return currentOpts.method === 'post' ? { method: 'patch' } : {}; + // return currentOpts.method === 'POST' ? { method: 'PATCH' } : {}; // } fetchOptions: '', diff --git a/src/storage_manager/index.js b/src/storage_manager/index.js index d0b41fbb6..6bb69ba26 100644 --- a/src/storage_manager/index.js +++ b/src/storage_manager/index.js @@ -218,7 +218,7 @@ export default () => { const st = this.getCurrentStorage(); const opts = { ...this.getCurrentOptons(), ...options }; const result = await this.__exec(st, opts); - console.log('onLOAD', { opts, result }); + return result; }, diff --git a/src/storage_manager/model/RemoteStorage.js b/src/storage_manager/model/RemoteStorage.js index 423a4817e..4540d9688 100644 --- a/src/storage_manager/model/RemoteStorage.js +++ b/src/storage_manager/model/RemoteStorage.js @@ -53,7 +53,7 @@ export default class RemoteStorage extends Model { } const result = { - method: body ? 'post' : 'get', + method: body ? 'POST' : 'GET', credentials: opts.credentials, headers, body,