From ac1906648b00dfa3d75aedda64a1285f13442c5c Mon Sep 17 00:00:00 2001 From: Vitor Mattos Date: Tue, 19 Nov 2024 18:26:11 -0300 Subject: [PATCH] fix: retrieve file when request to sign from file list Signed-off-by: Vitor Mattos --- src/store/files.js | 26 ++++++++++--------- .../FilesList/FileEntry/FileEntryActions.vue | 6 ++++- 2 files changed, 19 insertions(+), 13 deletions(-) diff --git a/src/store/files.js b/src/store/files.js index 892e0eab65..fa5e41d628 100644 --- a/src/store/files.js +++ b/src/store/files.js @@ -232,18 +232,20 @@ export const useFilesStore = function(...args) { if (!filter) { return this.files } - return Object.fromEntries( - Object.entries(this.files).filter(([key, value]) => { - if (filter.signer_uuid) { - // return true when found signer by signer_uuid - return value.signers.filter((signer) => { - // filter signers by signer_uuid - return signer.sign_uuid === filter.signer_uuid - }).length > 0 - } - return false - }), - ) + if (!filter.force_fetch) { + return Object.fromEntries( + Object.entries(this.files).filter(([key, value]) => { + if (filter.signer_uuid) { + // return true when found signer by signer_uuid + return value.signers.filter((signer) => { + // filter signers by signer_uuid + return signer.sign_uuid === filter.signer_uuid + }).length > 0 + } + return false + }), + ) + } } this.loading = true const url = !this.paginationNextUrl diff --git a/src/views/FilesList/FileEntry/FileEntryActions.vue b/src/views/FilesList/FileEntry/FileEntryActions.vue index 47c8261e30..f337f64717 100644 --- a/src/views/FilesList/FileEntry/FileEntryActions.vue +++ b/src/views/FilesList/FileEntry/FileEntryActions.vue @@ -173,7 +173,11 @@ export default { } return accumulator }, '') - this.signStore.setDocumentToSign(this.source) + const files = await this.filesStore.getAllFiles({ + signer_uuid: signUuid, + force_fetch: true, + }) + this.signStore.setDocumentToSign(files[this.source.nodeId]) this.$router.push({ name: 'SignPDF', params: {