Skip to content

Instantly share code, notes, and snippets.

@daniilgrigoryev
Created May 17, 2021 13:43
Show Gist options
  • Select an option

  • Save daniilgrigoryev/a6b659c149f9e1265d73460211c4bec2 to your computer and use it in GitHub Desktop.

Select an option

Save daniilgrigoryev/a6b659c149f9e1265d73460211c4bec2 to your computer and use it in GitHub Desktop.
someshit
async signFiles() {
try {
await this.initCryptoThumbprint()
let serializeDocuments = Object.entries(this.documents)
.map(([fileSystem, files]) => {
if (!!files.length) {
return files.map((fileID) => {
return { fileSystem, fileID }
})
}
})
.filter((item) => item !== undefined)
.flat()
return await Promise.all(
serializeDocuments.map((item) =>
this.getSig(item.fileSystem, item.fileID)
)
)
} catch (error) {
let errorMessage = error.message || `Возникла проблема во время подписания документов`
this.$emit('dialog', false)
this.pushSnackbar(true, 'red', errorMessage)
throw new Error(errorMessage)
}
},
async getSig(fileSystem, fileID) {
await $axios.get(`/api/v2/application/doc-for-sign/${fileSystem}/${fileID}`)
// const signFile = await this.$createAttachedSignature(this.thumbprint, fileBase.data.file, true)
// const uploadSign = await this.uploadSign(fileID, fileSystem, signFile)
// console.log(fileBase.status || 'error');
// console.log(fileBase);
// signFile && (this.countSignDocuments += 1)
// return fileBase
},
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment