fix: Fix typeorm .save usage (no-changelog) (#8678)

This commit is contained in:
Tomi Turtiainen
2024-02-20 17:34:54 +02:00
committed by GitHub
parent afd2eb1f4a
commit 05e13a68ea
14 changed files with 96 additions and 57 deletions

View File

@@ -12,7 +12,11 @@ export class SettingsRepository extends Repository<Settings> {
}
async getEncryptedSecretsProviderSettings(): Promise<string | null> {
return (await this.findOne({ where: { key: EXTERNAL_SECRETS_DB_KEY } }))?.value ?? null;
return (await this.findByKey(EXTERNAL_SECRETS_DB_KEY))?.value ?? null;
}
async findByKey(key: string): Promise<Settings | null> {
return await this.findOneBy({ key });
}
async saveEncryptedSecretsProviderSettings(data: string): Promise<void> {
@@ -38,7 +42,7 @@ export class SettingsRepository extends Repository<Settings> {
await this.update({ key }, { value, loadOnStartup: true });
} else {
value = JSON.stringify([bannerName]);
await this.save({ key, value, loadOnStartup: true });
await this.save({ key, value, loadOnStartup: true }, { transaction: false });
}
config.set(key, value);
return { success: true };