@@ -51,7 +51,7 @@ export default function makeServiceActions(service: Service<any>) {
51
51
return service
52
52
. get ( id , params )
53
53
. then ( async function ( item ) {
54
- await dispatch ( 'addOrUpdate' , item )
54
+ dispatch ( 'addOrUpdate' , item )
55
55
commit ( 'unsetPending' , 'get' )
56
56
return state . keyedById [ id ]
57
57
} )
@@ -99,7 +99,7 @@ export default function makeServiceActions(service: Service<any>) {
99
99
. create ( data , params )
100
100
. then ( async response => {
101
101
if ( Array . isArray ( response ) ) {
102
- await dispatch ( 'addOrUpdateList' , response )
102
+ dispatch ( 'addOrUpdateList' , response )
103
103
response = response . map ( item => {
104
104
const id = getId ( item , idField )
105
105
@@ -112,7 +112,7 @@ export default function makeServiceActions(service: Service<any>) {
112
112
if ( id != null && tempId != null ) {
113
113
commit ( 'updateTemp' , { id, tempId } )
114
114
}
115
- response = await dispatch ( 'addOrUpdate' , response )
115
+ response = dispatch ( 'addOrUpdate' , response )
116
116
117
117
// response = state.keyedById[id]
118
118
}
@@ -135,7 +135,7 @@ export default function makeServiceActions(service: Service<any>) {
135
135
return service
136
136
. update ( id , data , params )
137
137
. then ( async function ( item ) {
138
- await dispatch ( 'addOrUpdate' , item )
138
+ dispatch ( 'addOrUpdate' , item )
139
139
commit ( 'unsetPending' , 'update' )
140
140
return state . keyedById [ id ]
141
141
} )
@@ -165,7 +165,7 @@ export default function makeServiceActions(service: Service<any>) {
165
165
return service
166
166
. patch ( id , data , params )
167
167
. then ( async function ( item ) {
168
- await dispatch ( 'addOrUpdate' , item )
168
+ dispatch ( 'addOrUpdate' , item )
169
169
commit ( 'unsetPending' , 'patch' )
170
170
return state . keyedById [ id ]
171
171
} )
@@ -223,7 +223,7 @@ export default function makeServiceActions(service: Service<any>) {
223
223
const { qid = 'default' , query } = params
224
224
const { idField } = state
225
225
226
- await dispatch ( 'addOrUpdateList' , response )
226
+ dispatch ( 'addOrUpdateList' , response )
227
227
commit ( 'unsetPending' , 'find' )
228
228
229
229
const mapItemFromState = item => {
@@ -260,7 +260,7 @@ export default function makeServiceActions(service: Service<any>) {
260
260
return response
261
261
} ,
262
262
263
- async addOrUpdateList ( { state, commit } , response ) {
263
+ addOrUpdateList ( { state, commit } , response ) {
264
264
const list = response . data || response
265
265
const isPaginated = response . hasOwnProperty ( 'total' )
266
266
const toAdd = [ ]
@@ -311,7 +311,7 @@ export default function makeServiceActions(service: Service<any>) {
311
311
* the `create` response returns to create the record. The reference to the
312
312
* original temporary record must be maintained in order to preserve reactivity.
313
313
*/
314
- async addOrUpdate ( { state, commit } , item ) {
314
+ addOrUpdate ( { state, commit } , item ) {
315
315
const { idField } = state
316
316
const id = getId ( item , idField )
317
317
const existingItem = state . keyedById [ id ]
0 commit comments