File tree Expand file tree Collapse file tree 1 file changed +15
-6
lines changed
dash/dash-renderer/src/actions Expand file tree Collapse file tree 1 file changed +15
-6
lines changed Original file line number Diff line number Diff line change @@ -439,6 +439,7 @@ function handleServerside(
439
439
const fetchCallback = ( ) => {
440
440
const headers = getCSRFHeader ( ) as any ;
441
441
let url = `${ urlBase ( config ) } _dash-update-component` ;
442
+ let new_body = body
442
443
443
444
const addArg = ( name : string , value : string ) => {
444
445
let delim = '?' ;
@@ -447,11 +448,19 @@ function handleServerside(
447
448
}
448
449
url = `${ url } ${ delim } ${ name } =${ value } ` ;
449
450
} ;
450
- if ( cacheKey ) {
451
- addArg ( 'cacheKey' , cacheKey ) ;
452
- }
453
- if ( job ) {
454
- addArg ( 'job' , job ) ;
451
+ if ( cacheKey || job ) {
452
+ if ( cacheKey ) addArg ( 'cacheKey' , cacheKey ) ;
453
+ if ( job ) addArg ( 'job' , job ) ;
454
+
455
+ // clear inputs as background callback doesnt need inputs, just verify for context
456
+ let tmp_body = JSON . parse ( new_body )
457
+ for ( let i = 0 ; i < tmp_body . inputs . length ; i ++ ) {
458
+ tmp_body . inputs [ i ] [ 'value' ] = null ;
459
+ }
460
+ for ( let i = 0 ; i < tmp_body ?. state . length ; i ++ ) {
461
+ tmp_body . state [ i ] [ 'value' ] = null ;
462
+ }
463
+ new_body = JSON . stringify ( tmp_body )
455
464
}
456
465
457
466
if ( moreArgs ) {
@@ -464,7 +473,7 @@ function handleServerside(
464
473
mergeDeepRight ( config . fetch , {
465
474
method : 'POST' ,
466
475
headers,
467
- body
476
+ body : new_body ,
468
477
} )
469
478
) ;
470
479
} ;
You can’t perform that action at this time.
0 commit comments