Fix type changes, tag navigation, and routing cleanup

- set_entry removes entry from old bucket when type changes (fixes duplicates)
- PUT /api/entries/:id now accepts type field
- Tag clicks navigate via URL (#type/x/tag/y or #tag/y) instead of mutating state
- Replace magic 'all' hash with empty hash as the all-entries route
- Clickable tags in entry detail view
- Tag filter dropdown updates URL

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
2026-05-24 15:56:42 +00:00
parent 25c8f98b7f
commit 40722310ae
3 changed files with 44 additions and 9 deletions

View File

@@ -122,8 +122,9 @@ app.get('/api/entries/:id', (req, res) => {
app.put('/api/entries/:id', (req, res) => {
const existing = get_entry(Number(req.params.id));
if (!existing) { return fail(res, 'not found', 404); }
const { title, body, status, priority, tags, parent_id } = req.body;
const { type, title, body, status, priority, tags, parent_id } = req.body;
const updated = { ...existing, updated_at: Date.now() };
if (type !== undefined && get_entry_type(type)) { updated.type = type; }
if (title !== undefined) { updated.title = title.trim(); }
if (body !== undefined) { updated.body = body.trim(); }
if (status !== undefined) { updated.status = status; }