How to write this in less possible code?

Given that the field and direction to sort by are parsed and used separately, why are they being passed in using a single string in the first place? It seems like those should be formatted distinctly if possible: either as two different input fields or as a single input field with a non-underscore separator that won’t be present in the field name.