const { rows } = await db.execute(
sql`SELECT DISTINCT ${vehicleReferences.manufacturer} FROM ${vehicleReferences} WHERE ${vehicleReferences.vehType} = ${category}`
)
// Mapping the result to get only the brands as an Array
const vehTypes = rows.map((row) => row.manufacturer)
res.json({ brands: vehTypes })
const { rows } = await db.execute(
sql`SELECT DISTINCT ${vehicleReferences.manufacturer} FROM ${vehicleReferences} WHERE ${vehicleReferences.vehType} = ${category}`
)
// Mapping the result to get only the brands as an Array
const vehTypes = rows.map((row) => row.manufacturer)
res.json({ brands: vehTypes })