fix: registration enabled/disabled

This commit is contained in:
Andras Bacsai 2022-03-31 17:45:04 +02:00
parent 7b64166fb0
commit 96aef5c4a6

View File

@ -66,15 +66,10 @@ export const post: RequestHandler = async (event) => {
const { fqdn, isRegistrationEnabled, dualCerts, minPort, maxPort } = await event.request.json();
try {
const { id } = await db.listSettings();
if (isRegistrationEnabled) {
await db.prisma.setting.update({ where: { id }, data: { isRegistrationEnabled } });
}
await db.prisma.setting.update({ where: { id }, data: { isRegistrationEnabled, dualCerts } });
if (fqdn) {
await db.prisma.setting.update({ where: { id }, data: { fqdn } });
}
if (dualCerts) {
await db.prisma.setting.update({ where: { id }, data: { dualCerts } });
}
if (minPort && maxPort) {
await db.prisma.setting.update({ where: { id }, data: { minPort, maxPort } });
}