refactor: use model.getRoute in the catch-all instead of raw SQL

The app.all("*") dispatcher hand-rolled a SELECT * FROM routes while
every other read goes through the model layer. Use model.getRoute for
consistency; the handler only reads structure_id/id/verb/handler, all
of which it returns.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
Your Name 2026-08-02 22:32:30 -04:00
parent e45c890119
commit 386e65fa88

View file

@ -815,9 +815,7 @@ app.all("*", async (req, res) => {
if (routeMatch) {
req.params = routeMatch.params;
const route = db
.prepare("SELECT * FROM routes WHERE id = ?")
.get(routeMatch.id);
const route = model.getRoute(routeMatch.id);
const structure = model.getStructure(route.structure_id);