Restore images, more formatting and filter improvements

This commit is contained in:
2025-01-13 14:31:29 -05:00
parent 19d068191c
commit c57f69698b
5 changed files with 344 additions and 352 deletions

View File

@@ -218,6 +218,9 @@ router.get('/', async (req, res) => {
const [vendors] = await pool.query(
'SELECT DISTINCT vendor FROM products WHERE visible = true AND vendor IS NOT NULL AND vendor != "" ORDER BY vendor'
);
const [brands] = await pool.query(
'SELECT DISTINCT brand FROM products WHERE visible = true AND brand IS NOT NULL AND brand != "" ORDER BY brand'
);
// Main query with all fields
const query = `
@@ -300,7 +303,8 @@ router.get('/', async (req, res) => {
},
filters: {
categories: categories.map(category => category.name),
vendors: vendors.map(vendor => vendor.vendor)
vendors: vendors.map(vendor => vendor.vendor),
brands: brands.map(brand => brand.brand)
}
});
} catch (error) {