DI2 фикс коллизии: дашборд DI2 переименован в /api/di2/dashboard

DI2-роутер регистрируется перед основным dashboard.routes.ts и перехватывал
GET /api/dashboard (403 без finance.manage и неверный JSON — live-регрессия
главного дашборда CRM). Роут переименован, в DI2_PREFIXES /api/dashboard
заменён на /api/di2, клиент client-di2 ходит на новый путь (fetch + queryKey
+ prefetch в app-sidebar). Форматы старого модуля финансов не тронуты.
This commit is contained in:
2026-09-06 19:58:24 +03:00
parent 23ed1ecf3d
commit 49578ab442
4 changed files with 4 additions and 4 deletions

View File

@@ -12,7 +12,7 @@ const DI2_PREFIXES = [
"/api/expenses",
"/api/expense-categories",
"/api/debt",
"/api/dashboard",
"/api/di2",
"/api/profitability",
"/api/heatmap",
"/api/planning",

View File

@@ -1498,7 +1498,7 @@ export async function registerRoutes(httpServer: Server, app: Express): Promise<
return [`(${parts.join(" OR ")})`];
}
app.get("/api/dashboard", async (req, res) => {
app.get("/api/di2/dashboard", async (req, res) => {
try {
const cacheKey = stableKey("dashboard", req.query as Record<string, unknown>);
const result = await cachedQuery(cacheKey, TTL_LONG, async () => {