From 5c1c174db1cb8055dac42a92ff4c288255ad9b5e Mon Sep 17 00:00:00 2001 From: Jason Rasmussen Date: Tue, 28 Nov 2023 15:09:20 -0500 Subject: [PATCH] chore(server): curly braces (#5361) --- server/.eslintrc.js | 1 + server/src/domain/metadata/metadata.service.ts | 4 +++- server/src/infra/repositories/system-metadata.repository.ts | 4 +++- 3 files changed, 7 insertions(+), 2 deletions(-) diff --git a/server/.eslintrc.js b/server/.eslintrc.js index 17a0a2dd6..2e46281fe 100644 --- a/server/.eslintrc.js +++ b/server/.eslintrc.js @@ -19,6 +19,7 @@ module.exports = { '@typescript-eslint/explicit-module-boundary-types': 'off', '@typescript-eslint/no-explicit-any': 'off', '@typescript-eslint/no-floating-promises': 'error', + curly: 2, 'prettier/prettier': 0, }, }; diff --git a/server/src/domain/metadata/metadata.service.ts b/server/src/domain/metadata/metadata.service.ts index b3a19dac2..77dcfecb0 100644 --- a/server/src/domain/metadata/metadata.service.ts +++ b/server/src/domain/metadata/metadata.service.ts @@ -252,7 +252,9 @@ export class MetadataService { try { const reverseGeocode = await this.repository.reverseGeocode({ latitude, longitude }); - if (!reverseGeocode) return; + if (!reverseGeocode) { + return; + } Object.assign(exifData, reverseGeocode); } catch (error: Error | any) { this.logger.warn( diff --git a/server/src/infra/repositories/system-metadata.repository.ts b/server/src/infra/repositories/system-metadata.repository.ts index a4f3eeff0..d43002b0b 100644 --- a/server/src/infra/repositories/system-metadata.repository.ts +++ b/server/src/infra/repositories/system-metadata.repository.ts @@ -10,7 +10,9 @@ export class SystemMetadataRepository implements ISystemMetadataRepository { ) {} async get(key: T): Promise { const metadata = await this.repository.findOne({ where: { key } }); - if (!metadata) return null; + if (!metadata) { + return null; + } return metadata.value as SystemMetadata[T]; }