From 39a74510c1f00466acaead39f7bee003b3db60d7 Mon Sep 17 00:00:00 2001 From: Elias Schneider Date: Fri, 7 Apr 2023 23:13:44 +0200 Subject: [PATCH] fix: boolean config variables can't be set to false --- backend/src/config/config.service.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/backend/src/config/config.service.ts b/backend/src/config/config.service.ts index 41d5644e..d1eba311 100644 --- a/backend/src/config/config.service.ts +++ b/backend/src/config/config.service.ts @@ -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();