amtgard / ORK3

Version 3 of the Online Record Keeper
Other
23 stars 12 forks source link

Add optional sort order to player attendance api #245

Closed kenwalker closed 4 years ago

kenwalker commented 4 years ago

Without changing default behaviour, add optional order ['asc' | 'desc'] as part of the request. Personal request because I've written several voting tools and one of the very common requirements is a player must have played at least six months. I do not want to get every players total attendance, I just want the last one. So by setting a limit of 1 and order of asc this can be achieved and will make the reports that much more accurate.

If no parameter is provided, or the parameter does not match one of the two valid types, the original desc should be the default.

Pull request incoming.