Skip to content

Commit 4b37976

Browse files
committed
add isIdPending state per feathers method
1 parent 3d21be7 commit 4b37976

File tree

1 file changed

+16
-1
lines changed

1 file changed

+16
-1
lines changed

src/service-module/service-module.state.ts

Lines changed: 16 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ eslint
77
import _omit from 'lodash/omit'
88

99
import { MakeServicePluginOptions, Model } from './types'
10+
import { Id } from '@feathersjs/feathers'
1011

1112
export interface ServiceStateExclusiveDefaults {
1213
ids: string[]
@@ -36,6 +37,11 @@ export interface ServiceStateExclusiveDefaults {
3637
}
3738
paramsForServer: string[]
3839
modelName?: string
40+
41+
isIdCreatePending: Id[]
42+
isIdUpdatePending: Id[]
43+
isIdPatchPending: Id[]
44+
isIdRemovePending: Id[]
3945
}
4046

4147
export interface ServiceState<M extends Model = Model> {
@@ -77,6 +83,10 @@ export interface ServiceState<M extends Model = Model> {
7783
default?: PaginationState
7884
}
7985
modelName?: string
86+
isIdCreatePending: Id[]
87+
isIdUpdatePending: Id[]
88+
isIdPatchPending: Id[]
89+
isIdRemovePending: Id[]
8090
}
8191

8292
export interface PaginationState {
@@ -124,7 +134,12 @@ export default function makeDefaultState(options: MakeServicePluginOptions) {
124134
errorOnCreate: null,
125135
errorOnUpdate: null,
126136
errorOnPatch: null,
127-
errorOnRemove: null
137+
errorOnRemove: null,
138+
139+
isIdCreatePending: [],
140+
isIdUpdatePending: [],
141+
isIdPatchPending: [],
142+
isIdRemovePending: [],
128143
}
129144

130145
if (options.Model) {

0 commit comments

Comments
 (0)