mirror of
https://gitlab.com/wheres-the-tp/ui-mobile.git
synced 2026-01-25 17:04:55 -06:00
make POST requests to /quantity to update the quantity of an existing food item - then mixin the new quantity with the existing food items observable
17 lines
614 B
SQL
17 lines
614 B
SQL
SELECT
|
|
f.id AS id,
|
|
f.name AS name,
|
|
f.place_id AS place_id,
|
|
f.category AS category,
|
|
f.images AS images,
|
|
f.thumbImage AS thumbImage,
|
|
ST_AsGeoJSON(f.loc) AS location,
|
|
ST_Distance(f.loc, ST_SetSRID(ST_Point(-97.7286718, 30.3033267),4326)::geography) / 1609 AS distance,
|
|
q.quantity AS quantity,
|
|
q.date AS lastUpdated
|
|
FROM food_items f
|
|
LEFT OUTER JOIN latest_quantities q
|
|
ON f.id = q.food_item_id
|
|
WHERE ST_DWithin(loc, ST_SetSRID(ST_Point(-97.7286718, 30.3033267),4326)::geography, 20 * 1609)
|
|
AND f.category IN ('desserts', 'beverages', 'entrees', 'other')
|
|
ORDER BY distance ASC;
|