mirror of
https://github.com/R0m1k3/noteflow.git
synced 2026-10-19 13:18:16 +02:00
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:
4 files changed
+24
-5
No files matched your search
@@ -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 (
|
||||
|
||||
Reference in new issue
Block a user