fix(server): non-numeric route ids answer the legacy not-found, never NaN (tokens, categories, tags); mint path back to two statements; identity-map regression pinned

This commit is contained in:
jubnl
2026-09-22 21:08:06 +02:00
parent 8d0dddf385
commit 44cf31c958
13 changed files with 470 additions and 99 deletions
+10
View File
@@ -778,6 +778,16 @@ describe('MCP token management', () => {
.set('Cookie', authCookie(admin.id));
expect(res.status).toBe(404);
});
it('ADMIN-025 — DELETE /admin/mcp-tokens/abc (non-numeric id) returns the legacy 404, not a 500 (Plan 3b Task 2 review, F1)', async () => {
const { user: admin } = createAdmin(testDb);
const res = await request(app)
.delete('/api/admin/mcp-tokens/abc')
.set('Cookie', authCookie(admin.id));
expect(res.status).toBe(404);
expect(res.body).toEqual({ error: 'Token not found' });
});
});
// ─────────────────────────────────────────────────────────────────────────────