1
0
mirror of https://github.com/stonith404/pingvin-share.git synced 2024-06-30 06:30:11 +02:00

fix: boolean config variables can't be set to false

This commit is contained in:
Elias Schneider 2023-04-07 23:13:44 +02:00
parent b7db9b9b40
commit 39a74510c1
No known key found for this signature in database
GPG Key ID: 07E623B294202B6C

View File

@ -81,7 +81,7 @@ export class ConfigService {
if (!configVariable || configVariable.locked)
throw new NotFoundException("Config variable not found");
if (value == "") {
if (value === "") {
value = null;
} else if (
typeof value != configVariable.type &&
@ -100,7 +100,7 @@ export class ConfigService {
name: key.split(".")[1],
},
},
data: { value: value ? value.toString() : null },
data: { value: value === null ? null : value.toString() },
});
this.configVariables = await this.prisma.config.findMany();