diff --git a/packages/backend/src/services/chart/core.ts b/packages/backend/src/services/chart/core.ts index 04e98f97e8..ddcedba94b 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);