Skip to content

Commit dc617da

Browse files
committedMay 25, 2021
fix(model): merge request config recursively
1 parent 8399a2a commit dc617da

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed
 

‎src/Model.js

+3-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
import getProp from 'dotprop'
22
import setProp from 'dset'
3+
import merge from 'merge'
34
import { serialize } from 'object-to-formdata'
45

56
import Builder from './Builder'
@@ -305,7 +306,8 @@ export default class Model extends StaticModel {
305306
}
306307

307308
_reqConfig(config, options = { forceMethod: false }) {
308-
const _config = { ...config, ...this._config }
309+
// Merge cloned config to prevent changing the original config objects
310+
const _config = merge.recursive({ ...config }, { ...this._config })
309311

310312
// Prevent default request method from being overridden
311313
if (options.forceMethod) {

0 commit comments

Comments
 (0)
Please sign in to comment.