fix: tags contextuels — couleur envoyée et stockée par l'API
FlowDeck CI / test (push) Failing after 3s
FlowDeck CI / docker (push) Has been skipped

Backend (dashboard.py):
- POST /api/local-workspace/items/<id>/tags accepte maintenant 'color'
- INSERT INTO tags (name, color) au lieu de INSERT INTO tags (name)
- Si tag existe déjà, garde sa couleur existante

Frontend (local_workspace.html):
- ctxAddNewTag envoie {name, color} dans le body de la requête
  (avant: seul {name} était envoyé, la couleur était ignorée)
This commit is contained in:
2026-07-13 10:45:47 -04:00
parent 0ad1a69994
commit 92eca626b7
2 changed files with 4 additions and 3 deletions
+3 -2
View File
@@ -1281,6 +1281,7 @@ async def add_item_tag(request: Request, item_id: int):
import json
body = await request.json()
tag_name = body.get("name", "").strip().lower()
tag_color = body.get("color", "#787774")
if not tag_name:
return {"error": "Tag name required"}, 400
@@ -1289,11 +1290,11 @@ async def add_item_tag(request: Request, item_id: int):
tag = conn.execute("SELECT id, name, color FROM tags WHERE name = ?", (tag_name,)).fetchone()
if not tag:
cursor = conn.execute(
"INSERT INTO tags (name) VALUES (?)", (tag_name,)
"INSERT INTO tags (name, color) VALUES (?, ?)", (tag_name, tag_color)
)
conn.commit()
tag_id = cursor.lastrowid
tag = {"id": tag_id, "name": tag_name, "color": "#787774"}
tag = {"id": tag_id, "name": tag_name, "color": tag_color}
else:
tag_id = tag["id"]
+1 -1
View File
@@ -861,7 +861,7 @@ window._wsInitData = (function() {
color = color || this.ctxNewTagColor;
var r = await fetch('/api/local-workspace/items/' + node.id + '/tags', {
method: 'POST', headers: {'Content-Type':'application/json'},
body: JSON.stringify({name: tagName.trim()})
body: JSON.stringify({name: tagName.trim(), color: color})
});
if (r.ok) {
var d = await r.json();