1
1
/*
2
2
eslint
3
3
@typescript -eslint/explicit-function-return-type: 0,
4
- @typescript -eslint/no-explicit-any: 0
4
+ @typescript -eslint/no-explicit-any: 0,
5
+ no-var: 0
5
6
*/
6
7
import Vue from 'vue'
7
8
import { serializeError } from 'serialize-error'
@@ -397,10 +398,15 @@ export default function makeServiceMutations() {
397
398
state [ `is${ uppercaseMethod } Pending` ] = false
398
399
} ,
399
400
400
- setIdPending ( state , payload : { method : PendingIdServiceMethodName , id : Id | Id [ ] } ) : void {
401
+ setIdPending (
402
+ state ,
403
+ payload : { method : PendingIdServiceMethodName ; id : Id | Id [ ] }
404
+ ) : void {
401
405
const { method, id } = payload
402
406
const uppercaseMethod = method . charAt ( 0 ) . toUpperCase ( ) + method . slice ( 1 )
403
- const isIdMethodPending = state [ `isId${ uppercaseMethod } Pending` ] as ServiceState [ 'isIdCreatePending' ]
407
+ const isIdMethodPending = state [
408
+ `isId${ uppercaseMethod } Pending`
409
+ ] as ServiceState [ 'isIdCreatePending' ]
404
410
// if `id` is an array, ensure it doesn't have duplicates
405
411
const ids = Array . isArray ( id ) ? [ ...new Set ( id ) ] : [ id ]
406
412
ids . forEach ( id => {
@@ -409,10 +415,15 @@ export default function makeServiceMutations() {
409
415
}
410
416
} )
411
417
} ,
412
- unsetIdPending ( state , payload : { method : PendingIdServiceMethodName , id : Id | Id [ ] } ) : void {
418
+ unsetIdPending (
419
+ state ,
420
+ payload : { method : PendingIdServiceMethodName ; id : Id | Id [ ] }
421
+ ) : void {
413
422
const { method, id } = payload
414
423
const uppercaseMethod = method . charAt ( 0 ) . toUpperCase ( ) + method . slice ( 1 )
415
- const isIdMethodPending = state [ `isId${ uppercaseMethod } Pending` ] as ServiceState [ 'isIdCreatePending' ]
424
+ const isIdMethodPending = state [
425
+ `isId${ uppercaseMethod } Pending`
426
+ ] as ServiceState [ 'isIdCreatePending' ]
416
427
// if `id` is an array, ensure it doesn't have duplicates
417
428
const ids = Array . isArray ( id ) ? [ ...new Set ( id ) ] : [ id ]
418
429
ids . forEach ( id => {
@@ -423,7 +434,10 @@ export default function makeServiceMutations() {
423
434
} )
424
435
} ,
425
436
426
- setError ( state , payload : { method : PendingServiceMethodName ; error : Error } ) : void {
437
+ setError (
438
+ state ,
439
+ payload : { method : PendingServiceMethodName ; error : Error }
440
+ ) : void {
427
441
const { method, error } = payload
428
442
const uppercaseMethod = method . charAt ( 0 ) . toUpperCase ( ) + method . slice ( 1 )
429
443
state [ `errorOn${ uppercaseMethod } ` ] = Object . assign (
0 commit comments