feat: auto-save signer with status 0 when added

Automatically saves the signer to the server with status 0 (draft)
when the user adds a new signer through the Add Signer dialog.
This eliminates the need for a separate manual save action after
adding each signer.

The PATCH request is sent to /apps/libresign/api/v1/request-signature
with status: 0 immediately after the signer is added to the local state.

Signed-off-by: Vitor Mattos <1079143+vitormattos@users.noreply.github.com>
This commit is contained in:
Vitor Mattos 2025-12-11 13:27:01 -03:00
commit 66d95e7dcc
No known key found for this signature in database
GPG key ID: 6FECE2AD4809003A

View file

@ -113,7 +113,7 @@ export default {
this.displayName = signer?.displayName ?? ''
this.identify = signer?.id ?? ''
},
saveSigner() {
async saveSigner() {
if (!this.signer?.method || !this.signer?.id) {
return
}
@ -127,6 +127,13 @@ export default {
},
],
})
try {
await this.filesStore.saveWithVisibleElements({ visibleElements: [] })
} catch (error) {
console.error('Error saving signer:', error)
}
this.displayName = ''
this.identify = ''
this.signer = {}