fix: note du jour — contenu HTML (pas JSON TipTap) + type richtext
Some checks failed
CI / Lint, Unit Tests & Build (push) Failing after 1m25s
CI / Deploy production (on server) (push) Has been skipped

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
This commit is contained in:
Antigravity
2026-05-29 19:21:48 +00:00
parent c21c2d113a
commit 42aa374be6

View File

@@ -15,13 +15,8 @@ function getTodayContent(dateStr: string): string {
day: 'numeric',
}
const formatted = d.toLocaleDateString('fr-FR', options)
return JSON.stringify({
type: 'doc',
content: [
{ type: 'heading', attrs: { level: 1 }, content: [{ type: 'text', text: `📅 ${formatted}` }] },
{ type: 'paragraph', content: [{ type: 'text', text: '' }] },
],
})
// Store as HTML (same format as richtext notes via editor.getHTML())
return `<h1>📅 ${formatted}</h1><p></p>`
}
/**
@@ -42,7 +37,7 @@ export async function GET() {
where: {
userId,
title: today,
type: 'daily',
type: { in: ['richtext', 'daily'] },
trashedAt: null,
},
})
@@ -53,7 +48,7 @@ export async function GET() {
userId,
title: today,
content: getTodayContent(today),
type: 'daily',
type: 'richtext',
color: '#FEF9C3', // yellow-100 — distinguishes daily notes visually
labels: JSON.stringify(['daily']),
},