Restore images, more formatting and filter improvements
This commit is contained in:
@@ -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) {
|
||||
|
||||
Reference in New Issue
Block a user