Public: anyone can read this; the crew can change it.

Board routes leave api.ts for src/http/api/boards.ts #6943

opened this

Merged 37d 19h ago, live in production

The /api/v1/boards routes leave src/http/api.ts for the new src/http/api/boards.ts, which exports boardRoutes(router). Behaviour does not change. The moved routes are the source list, query, board list, pins (GET and POST), one board, one panel's data, PUT and DELETE.

Notes

opened this

The /api/v1/boards routes leave src/http/api.ts for the new src/http/api/boards.ts, which exports boardRoutes(router). Behaviour does not change. The moved routes are the source list, query, board list, pins (GET and POST), one board, one panel's data, PUT and DELETE. They keep their order, so /boards/pins is still added before /boards/:slug. boardFailed moved with them, along with the imports only they used, which api.ts no longer imports.

What to look at:

  • Where the call sits: boardRoutes(router) is where GET /api/v1/boards/sources used to be. The rest of the board block was split from it by POST /api/v1/drills, which stays in api.ts and now comes after the board routes. No path overlaps, so routing is unchanged.
  • The shared helper: boardsAdmin was a closure inside apiRoutes, and the drill route still uses it. It is now a function at module level, exported from api.ts where it already lived, and boards.ts imports it from there, as labels.ts does with loadRepo. Nothing is copied. This is one more small hunk in api.ts than the issue's "one removal, one call, one import".

bun x tsc --noEmit is clean. 215 tests in 17 files pass, with no test edited; they include the API and MCP board tests, mcp-size, openapi, security-floor-routes and the board timing suites. src/web/ is untouched, so the design lint did not apply.

To try it: as a site admin, GET /api/v1/boards and GET /api/v1/boards/pins on the preview answer as on production.

🤖 Generated with Claude Code

Closes #6326

commented

The /api/v1/boards routes leave src/http/api.ts for the new src/http/api/boards.ts, which exports boardRoutes(router). Behaviour does not change. The moved routes are the source list, query, board list, pins (GET and POST), one board, one panel's data, PUT and DELETE. They keep their order, so /boards/pins is still added before /boards/:slug. boardFailed moved with them, along with the imports only they used, which api.ts no longer imports.

What to look at:

  • Where the call sits: boardRoutes(router) is where GET /api/v1/boards/sources used to be. The rest of the board block was split from it by POST /api/v1/drills, which stays in api.ts and now comes after the board routes. No path overlaps, so routing is unchanged.
  • The shared helper: boardsAdmin was a closure inside apiRoutes, and the drill route still uses it. It is now a function at module level, exported from api.ts where it already lived, and boards.ts imports it from there, as labels.ts does with loadRepo. Nothing is copied. This is one more small hunk in api.ts than the issue's "one removal, one call, one import".

bun x tsc --noEmit is clean. 215 tests in 17 files pass, with no test edited; they include the API and MCP board tests, mcp-size, openapi, security-floor-routes and the board timing suites. src/web/ is untouched, so the design lint did not apply.

To try it: as a site admin, GET /api/v1/boards and GET /api/v1/boards/pins on the preview answer as on production.

🤖 Generated with Claude Code

commented

The /api/v1/boards routes leave src/http/api.ts for the new src/http/api/boards.ts, which exports boardRoutes(router). Behaviour does not change. The moved routes are the source list, query, board list, pins (GET and POST), one board, one panel's data, PUT and DELETE. They keep their order, so /boards/pins is still added before /boards/:slug. boardFailed moved with them, along with the imports only they used, which api.ts no longer imports.

What to look at:

  • Where the call sits: boardRoutes(router) is where GET /api/v1/boards/sources used to be. The rest of the board block was split from it by POST /api/v1/drills, which stays in api.ts and now comes after the board routes. No path overlaps, so routing is unchanged.
  • The shared helper: boardsAdmin was a closure inside apiRoutes, and the drill route still uses it. It is now a function at module level, exported from api.ts where it already lived, and boards.ts imports it from there, as labels.ts does with loadRepo. Nothing is copied. This is one more small hunk in api.ts than the issue's "one removal, one call, one import".
  • One test changed, because the test was wrong for this move: test/board-words.test.ts failed the first check. It required api.ts itself to contain BOARD_NOT_SAVED, and that sentence moved with the routes into api/boards.ts. The test now reads api.ts together with src/http/api/*.ts, the same way it already reads mcp.ts with its mcp/ modules. What it checks is unchanged: the sentence is imported from actions/board_words.ts and never typed out.

bun x tsc --noEmit is clean. The board, MCP (including mcp-size), openapi and security-floor suites pass, and so does every test that reads api.ts as source: 475 tests in 39 files. src/web/ is untouched, so the design lint did not apply.

To try it: as a site admin, GET /api/v1/boards and GET /api/v1/boards/pins on the preview answer as on production.

🤖 Generated with Claude Code

Sign in to join this conversation.

Search
↑↓ navigate ↵ open ⌘↵ its app esc close

Keyboard shortcuts

Docs