Closed rajadain closed 5 years ago
@azavea-bot rebuild
@azavea-bot rebuild
Please target release/1.0.0
prior to merge.
Thanks for taking a look and fixing the CI issues! I've retargeted this to release/1.0.0
. I'm not going to wait for CI again, since that branch is even with develop
which has already succeeded in CI. Merging now.
Overview
Even though the front-end sends the apiaries to the back-end in the correct order, and they are saved in the correct order, for some reason when they are queried for again, the serializer sends them back in reverse order:
https://github.com/project-icp/bee-pollinator-app/blob/3ab3582d60da4eb8e4845ab15139e98b6a01ce90/src/icp/apps/beekeepers/serializers.py#L56-L64
https://github.com/project-icp/bee-pollinator-app/blob/3ab3582d60da4eb8e4845ab15139e98b6a01ce90/src/icp/apps/beekeepers/views.py#L161-L170
It was unclear how this can be remedied on the DRF side, as the documentation did not provide any hints, nor could this question be found on Stack Overflow.
In the interest of expediency, I've decided to sort the results in the front-end when the Monthly Survey details modal is loaded. This ensures they are shown in the correct order, regardless of what order they are sent down from the API in.
Also adds a missing link.
Connects #459 Connects #497
Demo
First survey is for the colony "A":
Participate in Study link:
Testing Instructions
beekeepers start
2
as the number of coloniesFirst
Third
First
and the second tab beingThird
First
and the second tab beingThird