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(); const { fqdn, isRegistrationEnabled, dualCerts, minPort, maxPort } = await event.request.json();
try { try {
const { id } = await db.listSettings(); const { id } = await db.listSettings();
if (isRegistrationEnabled) { await db.prisma.setting.update({ where: { id }, data: { isRegistrationEnabled, dualCerts } });
await db.prisma.setting.update({ where: { id }, data: { isRegistrationEnabled } });
}
if (fqdn) { if (fqdn) {
await db.prisma.setting.update({ where: { id }, data: { fqdn } }); await db.prisma.setting.update({ where: { id }, data: { fqdn } });
} }
if (dualCerts) {
await db.prisma.setting.update({ where: { id }, data: { dualCerts } });
}
if (minPort && maxPort) { if (minPort && maxPort) {
await db.prisma.setting.update({ where: { id }, data: { minPort, maxPort } }); await db.prisma.setting.update({ where: { id }, data: { minPort, maxPort } });
} }