@@ -381,8 +381,15 @@ export const useFilesStore = function(...args) {
381381 filesSorted ( ) {
382382 return this . ordered . map ( key => this . files [ key ] )
383383 } ,
384- async saveWithVisibleElements ( { visibleElements = [ ] , signers = null , uuid = null , nodeId = null } ) {
384+ async saveWithVisibleElements ( { visibleElements = [ ] , signers = null , uuid = null , nodeId = null , signatureFlow = null } ) {
385385 const file = this . getFile ( )
386+
387+ let flowValue = signatureFlow || file . signatureFlow
388+ if ( typeof flowValue === 'number' ) {
389+ const flowMap = { 0 : 'none' , 1 : 'parallel' , 2 : 'ordered_numeric' }
390+ flowValue = flowMap [ flowValue ] || 'parallel'
391+ }
392+
386393 const config = {
387394 url : generateOcsUrl ( '/apps/libresign/api/v1/request-signature' ) ,
388395 method : uuid || file . uuid ? 'patch' : 'post' ,
@@ -391,10 +398,12 @@ export const useFilesStore = function(...args) {
391398 users : signers || file . signers ,
392399 visibleElements,
393400 status : 0 ,
401+ signatureFlow : flowValue ,
394402 } ,
395403 }
396404
397- if ( uuid || file . uuid ) {
405+
406+ if ( uuid || file . uuid ) {
398407 config . data . uuid = uuid || file . uuid
399408 } else {
400409 config . data . file = {
@@ -406,8 +415,15 @@ export const useFilesStore = function(...args) {
406415 this . addFile ( data . ocs . data . data )
407416 return data . ocs . data
408417 } ,
409- async updateSignatureRequest ( { visibleElements = [ ] , signers = null , uuid = null , nodeId = null , status = 1 } ) {
418+ async updateSignatureRequest ( { visibleElements = [ ] , signers = null , uuid = null , nodeId = null , status = 1 , signatureFlow = null } ) {
410419 const file = this . getFile ( )
420+
421+ let flowValue = signatureFlow || file . signatureFlow
422+ if ( typeof flowValue === 'number' ) {
423+ const flowMap = { 0 : 'none' , 1 : 'parallel' , 2 : 'ordered_numeric' }
424+ flowValue = flowMap [ flowValue ] || 'parallel'
425+ }
426+
411427 const config = {
412428 url : generateOcsUrl ( '/apps/libresign/api/v1/request-signature' ) ,
413429 method : uuid || file . uuid ? 'patch' : 'post' ,
@@ -416,6 +432,7 @@ export const useFilesStore = function(...args) {
416432 users : signers || file . signers ,
417433 visibleElements,
418434 status,
435+ signatureFlow : flowValue ,
419436 } ,
420437 }
421438
@@ -426,7 +443,6 @@ export const useFilesStore = function(...args) {
426443 fileId : nodeId || this . selectedNodeId ,
427444 }
428445 }
429-
430446 const { data } = await axios ( config )
431447 this . addFile ( data . ocs . data . data )
432448 return data . ocs . data
0 commit comments