Closed bltMustafa closed 1 year ago
I'm working on it, you can assign me
What do you think about this sql query?
SELECT vc.id AS volunteer_count_id,
b.id AS building_id, b.name AS building_name,
bb.box_no
FROM volunteer_counts vc
JOIN (
SELECT *
FROM buildings
WHERE id IN (
SELECT building_id
FROM volunteer_counts
WHERE neighbourhood_id = <params_id>
LIMIT 1
)
) b ON vc.building_id = b.id
JOIN ballot_boxes bb ON b.id = bb.building_id;
Example Output: | volunteer_count_id | building_id | building_name | box_no |
---|---|---|---|---|
2 | 3 | deneme | 123123 | |
2 | 3 | deneme | 12312312 |
/api/feed/<neighbourhoodId>
determine the timepast field.. check formulation for finalRank output..
{ "neighbourhoodId": "<-id->", "lastUpdateTime": "<-timepast?->", "intensity": "<-finalRank->", "details": [ "<-building-name-0-> - <-ballot_boxes.box_no in that building_id-0->", "<-building-name-1-> - <-ballot_boxes.box_no in that building_id-1->" ], }
Shouldn't the details be better for frontend if something like the below:
"details" : [
{"building_name": "ATATURK ILKOKULU", "ballot_box_nos": [1,2,3,4,5]}
]
@kingofsevens @bltMustafa @ssibrahimbas
It is better of course.. @bltMustafa can you comment the changes on the FE issue. Thank you
I also find it more logical to send it as an object. It can be shaped as desired in the frontend. However, I can still extract it in that format however you want. It is currently returning as a string as it is written in the issue.
/api/feed/<neighbourhoodId>
determine the timepast field.. check formulation for finalRank output..