update post Envelope to handle without object
This commit is contained in:
@@ -275,35 +275,30 @@ class App {
|
||||
|
||||
// Export annotation data and save to database
|
||||
try {
|
||||
const json = await iJSON
|
||||
const postEnvelopeResult = await this.Network.postEnvelope(
|
||||
this.currentDocument.id,
|
||||
json
|
||||
)
|
||||
const res = await this.Network.postEnvelope(this.envelopeKey, await iJSON);
|
||||
|
||||
if (postEnvelopeResult.fatal) {
|
||||
Swal.fire({
|
||||
title: 'Fehler',
|
||||
text: 'Umschlag konnte nicht signiert werden!',
|
||||
icon: 'error',
|
||||
})
|
||||
return false
|
||||
}
|
||||
|
||||
if (postEnvelopeResult.error) {
|
||||
Swal.fire({
|
||||
title: 'Warnung',
|
||||
text: 'Umschlag ist nicht mehr verfügbar.',
|
||||
icon: 'warning',
|
||||
})
|
||||
return false
|
||||
}
|
||||
|
||||
return true
|
||||
if (!res.ok) {
|
||||
if (res.status === 403) {
|
||||
Swal.fire({
|
||||
title: 'Warnung',
|
||||
text: 'Umschlag ist nicht mehr verfügbar.',
|
||||
icon: 'warning',
|
||||
})
|
||||
return false
|
||||
}
|
||||
else {
|
||||
throw new Error()
|
||||
}
|
||||
} else
|
||||
return true
|
||||
} catch (e) {
|
||||
Swal.fire({
|
||||
title: 'Fehler',
|
||||
text: 'Umschlag konnte nicht signiert werden!',
|
||||
icon: 'error',
|
||||
})
|
||||
return false
|
||||
}
|
||||
//---
|
||||
}
|
||||
else
|
||||
return false;
|
||||
|
||||
Reference in New Issue
Block a user