Merge pull request #695 from chaptergy/failed-certificate-autoremove
Adds autoremove of failed certificate creations in DB
This commit is contained in:
commit
540554c4f6
@ -216,6 +216,13 @@ const internalCertificate = {
|
||||
return saved_row;
|
||||
});
|
||||
});
|
||||
}).catch(async (error) => {
|
||||
// Delete the certificate from the database if it was not created successfully
|
||||
await certificateModel
|
||||
.query()
|
||||
.deleteById(certificate.id);
|
||||
|
||||
throw error;
|
||||
});
|
||||
} else {
|
||||
return certificate;
|
||||
|
Loading…
Reference in New Issue
Block a user