-
Notifications
You must be signed in to change notification settings - Fork 1
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[PROD] Situation report list order #1395
Labels
type: bug
Something isn't working
Comments
Could be solved on backend side via IFRCGo/go-api#2275 |
You can test it on Staging, e.g. on https://go-stage.ifrc.org/emergencies/6700/reports |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Issue
Recently it is not possible to set a situation report order, situation reports show randomly on emergency pages.
We should use an
&ordering=created_at
part in the request.Details:
From backend side it would be possible to order by created_at and name:
https://github.com/IFRCGo/go-api/blob/develop/api/drf_views.py#L782-L784
But the client does not send any of them.
E.g.
https://go.ifrc.org/emergencies/6700/reports :
https://goadmin.ifrc.org/api/v2/situation_report/?event=6700&limit=9999
gives this order:
Middle East Complex Emergency - SITREP N.2
Middle East Complex Emergency - SITREP N.10
Middle East Complex Emergency - SITREP N.13
Middle East Complex Emergency - SITREP N.1
Middle East Complex Emergency - SITREP N.4
This is not date neither name order.
If we insert an
&ordering=created_at
https://goadmin.ifrc.org/api/v2/situation_report/?event=6700&ordering=created_at&limit=9999
If a more sophisticated version is needed, we can insert a "position" or "order" integer to expicitely being able to define ordering.
Also on backend side Admin it would be nice to – at least – see created_at, because recently it can not be seen anywhere, just in the database.
The text was updated successfully, but these errors were encountered: