mirror of
https://github.com/Drop-OSS/drop.git
synced 2026-06-22 04:11:32 +10:00
fix: ignore error if we are unable to blacklist certificate
This commit is contained in:
@@ -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;
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
|
|||||||
Reference in New Issue
Block a user