feat: admin auto-redirect to first company on / + bump 0.4.3
This commit is contained in:
@@ -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) {
|
||||
|
||||
Reference in New Issue
Block a user