Guard camera query against empty strings

This commit is contained in:
Sam Becker 2024-01-10 15:54:29 -06:00
parent fdc1d383c1
commit a8906e273f

View File

@ -242,8 +242,8 @@ const sqlGetUniqueCameras = async () => sql`
SELECT DISTINCT make||' '||model as camera, make, model, COUNT(*)
FROM photos
WHERE hidden IS NOT TRUE
AND make IS NOT NULL
AND model IS NOT NULL
AND trim(make) <> ''
AND trim(model) <> ''
GROUP BY make, model
ORDER BY camera ASC
`.then(({ rows }): Cameras => rows.map(({ make, model, count }) => ({