@@ -206,12 +206,6 @@ export default {
206206 envelope () {
207207 return this .filesStore .getFile ()
208208 },
209- envelopeUuid () {
210- return this .envelope .uuid
211- },
212- envelopeId () {
213- return this .envelope .id
214- },
215209 canDelete () {
216210 return this .envelope ? .status === SIGN_STATUS .DRAFT && this .files .length >= 1
217211 },
@@ -276,7 +270,7 @@ export default {
276270 },
277271 methods: {
278272 async loadFiles (page = 1 ) {
279- if (! this .envelopeId ) {
273+ if (! this .envelope ? . id ) {
280274 return
281275 }
282276
@@ -291,7 +285,7 @@ export default {
291285 const params = new URLSearchParams ({
292286 page: page,
293287 length: 50 ,
294- parentFileId: this .envelopeId ,
288+ parentFileId: this .envelope . id ,
295289 })
296290
297291 await axios .get (` ${ url} ?${ params .toString ()} ` )
@@ -368,7 +362,7 @@ export default {
368362 source: fileUrl,
369363 basename: file .name ,
370364 mime: ' application/pdf' ,
371- fileid: file .nodeId ,
365+ fileid: file .id ,
372366 }
373367 OCA .Viewer .open ({
374368 fileInfo,
@@ -410,7 +404,7 @@ export default {
410404 this .hasLoading = true
411405 const fileIds = [... this .selectedFiles ]
412406
413- const result = await this .filesStore .removeFilesFromEnvelope (this . envelopeId , fileIds)
407+ const result = await this .filesStore .removeFilesFromEnvelope (fileIds)
414408
415409 if (result .success ) {
416410 // Remover arquivos da lista local
@@ -453,7 +447,7 @@ export default {
453447 const abortController = new AbortController ()
454448 this .uploadAbortController = abortController
455449
456- const result = await this .filesStore .addFilesToEnvelope (this .envelopeUuid , formData, {
450+ const result = await this .filesStore .addFilesToEnvelope (this .envelope . uuid , formData, {
457451 signal: abortController .signal ,
458452 onUploadProgress : (progressEvent ) => {
459453 if (progressEvent .total ) {
@@ -467,9 +461,6 @@ export default {
467461 this .showSuccess (this .t (' libresign' , result .message ))
468462 this .files .push (... result .files )
469463 this .totalFiles = result .filesCount
470- if (this .envelopeId && this .filesStore .files [this .envelopeId ]) {
471- this .filesStore .files [this .envelopeId ].filesCount = result .filesCount
472- }
473464 } else {
474465 if (result .message !== ' Upload cancelled' ) {
475466 this .showError (this .t (' libresign' , result .message ))
@@ -558,7 +549,7 @@ export default {
558549 async confirmDelete (file ) {
559550 this .hasLoading = true
560551
561- const result = await this .filesStore .removeFilesFromEnvelope (this . envelopeId , file .id )
552+ const result = await this .filesStore .removeFilesFromEnvelope ([ file .id ] )
562553
563554 if (result .success ) {
564555 this .showSuccess (this .t (' libresign' , result .message ))
0 commit comments