mirror of
https://github.com/R0m1k3/noteflow.git
synced 2026-10-11 17:29:37 +02:00
Fix: Correction requête SQL pour les tags dans les notes
Correction d'une erreur critique qui empêchait le chargement des notes: - La requête tentait de joindre une table "tags" inexistante - La structure réelle utilise directement la colonne "tag" dans note_tags - Correction: SELECT id, tag as name FROM note_tags au lieu de la jointure Cette erreur causait: - SQLITE_ERROR: no such table: tags - Disparition des notes après création - Impossibilité de charger la liste des notes Fix immédiat pour restaurer le fonctionnement normal de l'application.
This commit is contained in:
1 file changed
+4
-5
@@ -86,11 +86,10 @@ router.get('/', async (req, res) => {
|
||||
note.files_count = files?.length || 0;
|
||||
|
||||
const tags = await getAll(`
|
||||
SELECT t.id, t.name
|
||||
FROM tags t
|
||||
INNER JOIN note_tags nt ON t.id = nt.tag_id
|
||||
WHERE nt.note_id = ?
|
||||
ORDER BY t.name ASC
|
||||
SELECT id, tag as name
|
||||
FROM note_tags
|
||||
WHERE note_id = ?
|
||||
ORDER BY tag ASC
|
||||
`, [note.id]);
|
||||
note.tags = tags || [];
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user