fix idp on started
This commit is contained in:
@@ -41,6 +41,20 @@ export class SettingsService {
|
||||
}
|
||||
|
||||
async upsert(command: UpsertSettingCommand) {
|
||||
const trimmedValue = command.value?.trim() ?? '';
|
||||
if (command.isSecret && trimmedValue === '') {
|
||||
const existing = await this.prisma.systemSetting.findUnique({ where: { key: command.key } });
|
||||
if (existing) {
|
||||
return this.prisma.systemSetting.update({
|
||||
where: { key: command.key },
|
||||
data: {
|
||||
description: command.description,
|
||||
isSecret: command.isSecret ?? existing.isSecret
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
return this.prisma.systemSetting.upsert({
|
||||
where: { key: command.key },
|
||||
create: {
|
||||
|
||||
Reference in New Issue
Block a user