feat: unified Catalog page with Location→Category→Subcategory→Product tree
- New /catalog page with tree view: Location (🌍) → Category (📂) → Subcategory (📁) → Product - Add/delete locations, categories, subcategories, products from one page - JS-powered subcategory dropdown filtered by category - Sticky sidebar with Add Location/Category/Product forms - Responsive grid layout (tree + forms side by side, stacks on mobile) - Navigation simplified: Catalog replaces separate Locations/Categories/Products - Old routes still accessible for backward compatibility - Subcategories table migration (006_subcategories.js) - subcategory_id column added to products table - Seed data includes subcategories (VPN, Accounts, Hardware, etc.)
This commit is contained in:
@@ -5,6 +5,7 @@ import { dirname, join } from 'path';
|
||||
import logger from '../utils/logger.js';
|
||||
import { requireAuth, handleLogin, handleLogout, renderLogin } from './auth.js';
|
||||
import dashboardRouter from './routes/dashboard.js';
|
||||
import catalogRouter from './routes/catalog.js';
|
||||
import usersRouter from './routes/users.js';
|
||||
import productsRouter from './routes/products.js';
|
||||
import walletsRouter from './routes/wallets.js';
|
||||
@@ -13,6 +14,7 @@ import auditRouter from './routes/audit.js';
|
||||
import settingsRouter from './routes/settings.js';
|
||||
import categoriesRouter from './routes/categories.js';
|
||||
import paymentWalletsRouter from './routes/paymentWallets.js';
|
||||
import locationsRouter from './routes/locations.js';
|
||||
import seedRouter from './routes/seed.js';
|
||||
|
||||
const __dirname = dirname(fileURLToPath(import.meta.url));
|
||||
@@ -36,6 +38,7 @@ app.get('/logout', handleLogout);
|
||||
app.use(requireAuth);
|
||||
|
||||
app.use('/', dashboardRouter);
|
||||
app.use('/catalog', catalogRouter);
|
||||
app.use('/users', usersRouter);
|
||||
app.use('/products', productsRouter);
|
||||
app.use('/wallets', walletsRouter);
|
||||
@@ -43,6 +46,7 @@ app.use('/purchases', purchasesRouter);
|
||||
app.use('/audit', auditRouter);
|
||||
app.use('/settings', settingsRouter);
|
||||
app.use('/categories', categoriesRouter);
|
||||
app.use('/locations', locationsRouter);
|
||||
app.use('/payment-wallets', paymentWalletsRouter);
|
||||
app.use('/seed', seedRouter);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user