Skip to content

Commit

Permalink
fix: boolean config variables can't be set to false
Browse files Browse the repository at this point in the history
  • Loading branch information
stonith404 committed Apr 7, 2023
1 parent b7db9b9 commit 39a7451
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions backend/src/config/config.service.ts
Expand Up @@ -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 &&
Expand All @@ -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();
Expand Down

0 comments on commit 39a7451

Please sign in to comment.