datenanfragen / backend

While Datenanfragen.de is mostly run as a static site, some functionality does require a server. These endpoints are defined here.
MIT License
4 stars 6 forks source link

Suggest: Reorder JSON #32

Open mal-tee opened 3 years ago

mal-tee commented 3 years ago

Not sure if this is a bug with my fix of datenanfragen/website#187 or the backend, but sometimes the JSON is not "properly" ordered: The empty sources are at the end instead of above "required-elements".

https://github.com/datenanfragen/data/commit/0405391172a3492c4c1c4f5244bb308268e8d8f5

This is just a minor inconvenience.

HarshKumarChoudary commented 2 years ago

We just need to replace sources field from end to top of required-elements, isn't it. You could assign this task to me.

mal-tee commented 2 years ago

Almost, we want to reorder the JSON according to our schema. E.g. that's how we do it on website:

https://github.com/datenanfragen/website/blob/master/src/suggest-edit.js#L177-L192

Additionally we need to figure out how to give the backend access to a up-to-date version without firing a network request for every /suggest, that seems wasteful imo