Skip to content

Commit 225ee31

Browse files
committed
Fix calling getter from model with params
1 parent e08a969 commit 225ee31

File tree

1 file changed

+9
-3
lines changed

1 file changed

+9
-3
lines changed

src/service-module/make-base-model.ts

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -186,7 +186,7 @@ export default function makeBaseModel(options: FeathersVuexOptions) {
186186

187187
public static getFromStore(id, params?) {
188188
if (params) {
189-
return this._getters('get', [id, params])
189+
return this._getters('get', id, params)
190190
} else {
191191
return this._getters('get', id)
192192
}
@@ -272,10 +272,16 @@ export default function makeBaseModel(options: FeathersVuexOptions) {
272272
_commit.call(this.constructor, `createCopy`, id)
273273

274274
if (keepCopiesInStore) {
275-
return Object.assign(_getters.call(this.constructor, 'getCopyById', id), data)
275+
return Object.assign(
276+
_getters.call(this.constructor, 'getCopyById', id),
277+
data
278+
)
276279
} else {
277280
// const { copiesById } = this.constructor as typeof BaseModel
278-
return Object.assign((this.constructor as typeof BaseModel).copiesById[id], data)
281+
return Object.assign(
282+
(this.constructor as typeof BaseModel).copiesById[id],
283+
data
284+
)
279285
}
280286
}
281287
/**

0 commit comments

Comments
 (0)