fix: ignore error if we are unable to blacklist certificate

This commit is contained in:
DecDuck
2025-05-07 12:16:09 +10:00
parent c0c55d35f4
commit 770294d559
+12 -9
View File
@@ -70,14 +70,17 @@ export const dbCertificateStore = () => {
}; };
}, },
async blacklistCertificate(name: string) { async blacklistCertificate(name: string) {
await prisma.certificate.update({ try {
where: { await prisma.certificate.update({
id: name, where: {
}, id: name,
data: { },
blacklisted: true, data: {
}, blacklisted: true,
}); },
});
} finally {
}
}, },
async checkBlacklistCertificate(name: string): Promise<boolean> { async checkBlacklistCertificate(name: string): Promise<boolean> {
const result = await prisma.certificate.findUnique({ const result = await prisma.certificate.findUnique({
@@ -88,7 +91,7 @@ export const dbCertificateStore = () => {
blacklisted: true, blacklisted: true,
}, },
}); });
if (result === null) return false; if (result === null) return true;
return result.blacklisted; return result.blacklisted;
}, },
}; };