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:
parent
e45c890119
commit
386e65fa88
1 changed files with 1 additions and 3 deletions
4
index.js
4
index.js
|
|
@ -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);
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue