Skip to content

Commit

Permalink
Merge pull request #3962 from LibreSign/backport/3957/stable29
Browse files Browse the repository at this point in the history
[stable29] fix: filter files by signer uuid
  • Loading branch information
vitormattos authored Nov 15, 2024
2 parents 7cb396a + 843f352 commit 219e902
Showing 1 changed file with 15 additions and 1 deletion.
16 changes: 15 additions & 1 deletion src/store/files.js
Original file line number Diff line number Diff line change
Expand Up @@ -245,7 +245,21 @@ export const useFilesStore = function(...args) {
},
async getAllFiles(filter) {
if (this.loading || this.loadedAll) {
return this.files
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
}),
)
}
this.loading = true
const url = !this.paginationNextUrl
Expand Down

0 comments on commit 219e902

Please sign in to comment.