diff --git a/dist/mobx-spine.es.js b/dist/mobx-spine.es.js index e131aef..4f2085e 100644 --- a/dist/mobx-spine.es.js +++ b/dist/mobx-spine.es.js @@ -20,6 +20,7 @@ import { map, mapKeys, mapValues, + omit, result, sortBy, uniq, @@ -461,6 +462,7 @@ var Store = ( .fetchStore({ url: result(this, 'url'), data: data, + requestOptions: omit(options, 'data'), }) .then( action(function(res) { @@ -1814,7 +1816,11 @@ var Model = ( options.data ); return this.__getApi() - .fetchModel({ url: this.url, data: data }) + .fetchModel({ + url: this.url, + data: data, + requestOptions: omit(options, 'data'), + }) .then( action(function(res) { _this14.fromBackend(res); @@ -2154,9 +2160,10 @@ var BinderApi = (function() { key: 'fetchModel', value: function fetchModel(_ref) { var url = _ref.url, - data = _ref.data; + data = _ref.data, + requestOptions = _ref.requestOptions; - return this.get(url, data).then(function(res) { + return this.get(url, data, requestOptions).then(function(res) { return { data: res.data, repos: res.with, @@ -2260,9 +2267,10 @@ var BinderApi = (function() { key: 'fetchStore', value: function fetchStore(_ref5) { var url = _ref5.url, - data = _ref5.data; + data = _ref5.data, + requestOptions = _ref5.requestOptions; - return this.get(url, data).then(function(res) { + return this.get(url, data, requestOptions).then(function(res) { return { data: res.data, repos: res.with, diff --git a/dist/mobx-spine.umd.js b/dist/mobx-spine.umd.js index 7da06b5..b197b84 100644 --- a/dist/mobx-spine.umd.js +++ b/dist/mobx-spine.umd.js @@ -460,6 +460,10 @@ .fetchStore({ url: lodash.result(this, 'url'), data: data, + requestOptions: lodash.omit( + options, + 'data' + ), }) .then( mobx.action(function(res) { @@ -1896,7 +1900,14 @@ options.data ); return this.__getApi() - .fetchModel({ url: this.url, data: data }) + .fetchModel({ + url: this.url, + data: data, + requestOptions: lodash.omit( + options, + 'data' + ), + }) .then( mobx.action(function(res) { _this14.fromBackend(res); @@ -2244,9 +2255,12 @@ key: 'fetchModel', value: function fetchModel(_ref) { var url = _ref.url, - data = _ref.data; + data = _ref.data, + requestOptions = _ref.requestOptions; - return this.get(url, data).then(function(res) { + return this.get(url, data, requestOptions).then(function( + res + ) { return { data: res.data, repos: res.with, @@ -2352,9 +2366,12 @@ key: 'fetchStore', value: function fetchStore(_ref5) { var url = _ref5.url, - data = _ref5.data; + data = _ref5.data, + requestOptions = _ref5.requestOptions; - return this.get(url, data).then(function(res) { + return this.get(url, data, requestOptions).then(function( + res + ) { return { data: res.data, repos: res.with, diff --git a/package.json b/package.json index 0f9ae65..a4959c9 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "mobx-spine", - "version": "0.16.0", + "version": "0.16.1", "license": "ISC", "author": "Kees Kluskens ", "description": "MobX with support for models, relations and an API.",