feat: highlight notes created via API with red background

- Add created_via column to notes table (values: 'web' or 'api')
- Mark notes created via POST /api/notes/full as 'api'
- Display light red background for API-created notes in dashboard
- Add "API" badge with lightning icon for visual identification
This commit is contained in:
Claude committed 2025-12-21 16:50:56 +00:00
1 parent 239232c33c
commit 478b206be9
4 files changed
+24 -5

No files matched your search

+11
View File
@@ -123,11 +123,22 @@ async function initDatabase() {
archived BOOLEAN DEFAULT FALSE,
archived_at TIMESTAMP,
priority INTEGER DEFAULT 0,
created_via VARCHAR(20) DEFAULT 'web',
created_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP,
updated_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP
)
`);
// Migration: ajouter la colonne created_via si elle n'existe pas
await client.query(`
DO $$
BEGIN
IF NOT EXISTS (SELECT 1 FROM information_schema.columns WHERE table_name = 'notes' AND column_name = 'created_via') THEN
ALTER TABLE notes ADD COLUMN created_via VARCHAR(20) DEFAULT 'web';
END IF;
END $$;
`);
// Table note_todos
await client.query(`
CREATE TABLE IF NOT EXISTS note_todos (