Description
The frontend calls /tables?active=1 (frontend/src/app/(dashboard)/pos/page.tsx:94,106) but the backend GET route ignores the active query parameter entirely. Soft-deleted tables will appear in the POS.
Code Location
Frontend (pos/page.tsx:94):
const { data } = await api.get('/tables?active=1');
Backend (main/routes/tables.ts:8-39):
router.get('/', (req: Request, res: Response) => {
let query = 'SELECT * FROM tables WHERE 1=1';
const params: any[] = [];
if (req.query.status) { ... }
if (req.query.floor) { ... }
if (req.query.section) { ... }
if (req.query.kitchen_station_id) { ... }
// ❌ No handling for req.query.active
});
Impact
Currently low — the is_active column exists in the schema but isn't actively used for soft-delete. However:
- If soft-delete is ever implemented (set
is_active = 0 instead of DELETE), deleted tables will still appear in the POS
- The frontend is already sending
active=1, suggesting this was intended behavior
- Other routes (
/categories?active=1, /products?active=1) likely have the same issue
Suggested Fix
if (req.query.active) {
query += ' AND is_active = ?';
params.push(req.query.active);
}
Also verify /categories and /products GET routes handle the active parameter consistently.
Description
The frontend calls
/tables?active=1(frontend/src/app/(dashboard)/pos/page.tsx:94,106) but the backend GET route ignores theactivequery parameter entirely. Soft-deleted tables will appear in the POS.Code Location
Frontend (
pos/page.tsx:94):Backend (
main/routes/tables.ts:8-39):Impact
Currently low — the
is_activecolumn exists in the schema but isn't actively used for soft-delete. However:is_active = 0instead of DELETE), deleted tables will still appear in the POSactive=1, suggesting this was intended behavior/categories?active=1,/products?active=1) likely have the same issueSuggested Fix
Also verify
/categoriesand/productsGET routes handle theactiveparameter consistently.