When you order cores or capsules using the order querrystring, all vehicles where original_launch is null appear in the wrong order.
Using order=desc, I assume that those vehicles should be at the start of the output, since they'll be launch in the future.
And then, when order=asc, those vehicles should go to the end of the list.
Thanks.
This happens because mongodb and other databases generally treat null as the lowest possible value, hence why they show up first when in ascending order.
Should be able to fix this easily by splitting it into 2 queries, 1 for non null launch dates, and 1 for those will null haunch dates, and concatenating them together depending on the order.
That seems like a good idea to me!
/cores endpoint./cores/{upcoming, next, future, ...}./cores/upcoming and /cores/past would make sense, but /cores should probably contain all cores, just in a corrected order.
Not sure if we can have a /cores/next because the original launch date isn't added until after the launch time since it represents the current state of the core.
/cores/upcoming and /cores/past would make sense, but /cores should probably contain all cores, just in a corrected order.
So /cores/upcoming would have all null launch date cores, and /cores/past all non-null launch date cores.
And what about /cores then? What would be the difference between what we have now, and the updated one?
/cores would have both null and non null launch date cores, with the order fixed
Yeah, that's great!
@jesusrp98 Added and live
/cores
/cores/upcoming
/cores/past
/capsules
/capsules/upcoming
/capsules/past
Play around with it a bit, and let me know if you find anything out of place
If all is well, I'll update the docs with the changes 馃憤
Both endpoints works great!
Thank you very much! :1st_place_medal: