Fix API type mismatches with real pal-e-docs response #7

Merged
forgejo_admin merged 1 commit from hotfix/api-type-mismatch into main 2026-03-13 20:48:23 +00:00

Summary

Hotfix: align TypeScript interfaces with actual pal-e-docs API response shapes. The kanban board was returning 500 because field names didn't match.

Changes

  • src/lib/api.ts: Board uses name not title, item_counts not item_count, no columns/description. BoardItem uses item_type not note_type, note_slug not slug, labels is string|null. Added COLUMNS constant (7 fixed columns).
  • src/routes/boards/+page.svelte: Use board.name, compute total from item_counts, remove columns.length and description.
  • src/routes/boards/[slug]/+page.svelte: Use item.item_type, board.name, tab.name, compute tab counts from item_counts, fix labels rendering (split comma string), remove item.project badge.

Test Plan

  • npm run check — 0 errors, 0 warnings
  • npm run build — succeeds
  • /boards loads without 500
  • /boards/board-pal-e-docs renders kanban with real items

Review Checklist

  • No unrelated changes
  • TypeScript passes
  • Build succeeds
  • plan-pal-e-docs — Phase 3 hotfix
  • Issue #3

Closes #3

## Summary Hotfix: align TypeScript interfaces with actual pal-e-docs API response shapes. The kanban board was returning 500 because field names didn't match. ## Changes - `src/lib/api.ts`: Board uses `name` not `title`, `item_counts` not `item_count`, no `columns`/`description`. BoardItem uses `item_type` not `note_type`, `note_slug` not `slug`, `labels` is `string|null`. Added `COLUMNS` constant (7 fixed columns). - `src/routes/boards/+page.svelte`: Use `board.name`, compute total from `item_counts`, remove `columns.length` and `description`. - `src/routes/boards/[slug]/+page.svelte`: Use `item.item_type`, `board.name`, `tab.name`, compute tab counts from `item_counts`, fix labels rendering (split comma string), remove `item.project` badge. ## Test Plan - [x] `npm run check` — 0 errors, 0 warnings - [x] `npm run build` — succeeds - [ ] `/boards` loads without 500 - [ ] `/boards/board-pal-e-docs` renders kanban with real items ## Review Checklist - [x] No unrelated changes - [x] TypeScript passes - [x] Build succeeds ## Related - `plan-pal-e-docs` — Phase 3 hotfix - Issue #3 Closes #3
Fix API type mismatches: align TypeScript interfaces with real pal-e-docs API
All checks were successful
ci/woodpecker/pr/woodpecker Pipeline was successful
310f6d0838
Board: name (not title), item_counts (not item_count), no columns/description.
BoardItem: item_type (not note_type), note_slug (not slug), labels is string|null.
Columns are fixed (hardcoded COLUMNS constant).

Closes #3

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
forgejo_admin deleted branch hotfix/api-type-mismatch 2026-03-13 20:48:23 +00:00
Sign in to join this conversation.
No reviewers
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
forgejo_admin/pal-e-docs-app!7
No description provided.