File tree Expand file tree Collapse file tree 2 files changed +10
-4
lines changed Expand file tree Collapse file tree 2 files changed +10
-4
lines changed Original file line number Diff line number Diff line change @@ -23,7 +23,7 @@ export default function makeServiceModule(
23
23
state : makeDefaultState ( options ) ,
24
24
getters : makeGetters ( ) ,
25
25
mutations : makeMutations ( ) ,
26
- actions : makeActions ( service )
26
+ actions : makeActions ( { service, options } )
27
27
}
28
28
const fromOptions = _pick ( options , [
29
29
'state' ,
Original file line number Diff line number Diff line change 6
6
import fastCopy from 'fast-copy'
7
7
import { getId } from '../utils'
8
8
import { Service } from '@feathersjs/feathers'
9
+ import { MakeServicePluginOptions } from './types'
9
10
10
- export default function makeServiceActions ( service : Service < any > ) {
11
+ interface serviceAndOptions {
12
+ service : Service < any >
13
+ options : MakeServicePluginOptions
14
+ }
15
+
16
+ export default function makeServiceActions ( { service, options} : serviceAndOptions ) {
11
17
const serviceActions = {
12
18
find ( { commit, dispatch } , params ) {
13
19
params = params || { }
@@ -322,9 +328,9 @@ export default function makeServiceActions(service: Service<any>) {
322
328
commit ( 'removeItems' , toRemove ) // commit removal
323
329
}
324
330
325
- if ( service . FeathersVuexModel ) {
331
+ if ( options . Model ) {
326
332
toAdd . forEach ( ( item , index ) => {
327
- toAdd [ index ] = new service . FeathersVuexModel ( item , { commit : false } )
333
+ toAdd [ index ] = new options . Model ( item , { commit : false } )
328
334
} )
329
335
}
330
336
You can’t perform that action at this time.
0 commit comments