orderBy was getting overriden by Select when set to search, because Select would then lookup the value in the Options to update the selectedIndex, but end up with -1, and set orderBy to null/undefined.
This was causing the mods query to be sent with order=desc, but without orderBy, which returned an internal server error (report on discord).
There are two solutions for this: this PR's, and delaying setting orderBy by one tick, giving Select time to receive the updated Options, but the latter would trigger two separate API requests.
Additionally, the order is set to search on page load, if the search URL parameter is present.
orderBy
was getting overriden by Select when set tosearch
, because Select would then lookup the value in the Options to update theselectedIndex
, but end up with-1
, and setorderBy
to null/undefined. This was causing the mods query to be sent withorder=desc
, but withoutorderBy
, which returned an internal server error (report on discord). There are two solutions for this: this PR's, and delaying settingorderBy
by one tick, giving Select time to receive the updatedOptions
, but the latter would trigger two separate API requests.Additionally, the order is set to
search
on page load, if the search URL parameter is present.