From a6177c4cefb223fbec0d105bd9588e98d2ca40ed Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E2=80=9CNaeel=E2=80=9D?= Date: Sun, 31 May 2026 06:15:37 +0300 Subject: [PATCH] feat: admin auto-redirect to first company on / + bump 0.4.3 --- package.json | 2 +- ui/routes/entries.js | 6 ++++++ 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/package.json b/package.json index 48c4a43..33430e4 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "ipwhitelist", - "version": "0.4.2", + "version": "0.4.3", "description": "IP WhiteList microservice for cloud provider", "main": "server.js", "scripts": { diff --git a/ui/routes/entries.js b/ui/routes/entries.js index 53d264b..942e77e 100644 --- a/ui/routes/entries.js +++ b/ui/routes/entries.js @@ -37,6 +37,12 @@ function createRouter() { companies = cr.data.companies || []; const companyId = req.query.company ? parseInt(req.query.company, 10) : null; + + // Если company не выбрана — редиректим на первую в списке + if (!companyId && companies.length > 0) { + return res.redirect('/?company=' + companies[0].id); + } + selectedCompany = companyId ? companies.find(c => c.id === companyId) || null : null; if (selectedCompany) {