Skip to content

Conversation

@taki3210
Copy link
Collaborator

記録機能の追加(feature/recoding)を改善したものです。
・route.tsでdailyRecord.tsを再呼び込みしなくて済むようにした
・2週間のうちの一日目のみうまく動作しなかった部分を改善した

自分でテストすると動作しました。

@taki3210 taki3210 changed the title 記録機能の追加(feature/recoding)を改善したものです。 記録機能の追加(feature/recoding)の改善 Oct 31, 2025
Comment on lines 66 to 85
function writeRawRecords(records: any[]): boolean {
try {
fs.writeFileSync(DATA_FILE, JSON.stringify(records, null, 2), 'utf8')
return true
} catch (err) {
console.error('writeRawRecords error:', err)
return false
}
try {
fs.writeFileSync(DATA_FILE, JSON.stringify(records, null, 2), 'utf8')
return true
} catch (err) {
console.error('writeRawRecords error:', err)
return false
}
}

function writeRecords(records: DailyRecord[]): boolean {
try {
const out = records.map(serializeRecord)
fs.writeFileSync(DATA_FILE, JSON.stringify(out, null, 2), 'utf8')
return true
} catch (err) {
console.error('writeRecords error', err)
return false
}
try {
const out = records.map(serializeRecord)
fs.writeFileSync(DATA_FILE, JSON.stringify(out, null, 2), 'utf8')
return true
} catch (err) {
console.error('writeRecords error', err)
return false
}
}
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

前のPRでコメント出来ていなくて申し訳ないんだけど、これだと、意図したとおりに保存できる実装じゃないんじゃないかなぁ...
テキストで説明するの難しいので、次回のプロジェクトの時にでも...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants