From 4a2425800761eb3e4d0870485e51871f03295a19 Mon Sep 17 00:00:00 2001 From: syuilo Date: Sun, 13 Feb 2022 12:46:52 +0900 Subject: [PATCH] refactor: fix types --- packages/backend/src/services/chart/core.ts | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/packages/backend/src/services/chart/core.ts b/packages/backend/src/services/chart/core.ts index 04e98f97e..ddcedba94 100644 --- a/packages/backend/src/services/chart/core.ts +++ b/packages/backend/src/services/chart/core.ts @@ -266,7 +266,7 @@ export default abstract class Chart { const currentLog = await repository.findOne({ date: Chart.dateToTimestamp(current), ...(group ? { group: group } : {}), - }) as RawRecord; + }) as RawRecord | undefined; // ログがあればそれを返して終了 if (currentLog != null) { @@ -306,7 +306,7 @@ export default abstract class Chart { const currentLog = await repository.findOne({ date: date, ...(group ? { group: group } : {}), - }) as RawRecord; + }) as RawRecord | undefined; // ログがあればそれを返して終了 if (currentLog != null) return currentLog; @@ -576,7 +576,7 @@ export default abstract class Chart { order: { date: -1, }, - }) as RawRecord; + }) as RawRecord | undefined; if (recentLog) { logs = [recentLog]; @@ -593,7 +593,7 @@ export default abstract class Chart { order: { date: -1, }, - }) as RawRecord; + }) as RawRecord | undefined; if (outdatedLog) { logs.push(outdatedLog);