Sort Order for tasks #110
No reviewers
Labels
No Label
dependencies
duplicate
help wanted
invalid
kind/bug
kind/feature
needs reproduction
question
security
wontfix
No Milestone
No Assignees
2 Participants
Notifications
Due Date
No due date set.
Dependencies
No dependencies set.
Reference: vikunja/vikunja#110
Loading…
Reference in New Issue
No description provided.
Delete Branch "feature/sort-order"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Description
Checklist
go mod vendor
make do-the-swag
)@ -257,0 +324,4 @@
// This is a descending sort, so we need to negate the comparator (i.e. switch the inputs).
if param.orderBy == "desc" {
oldComparator := comparator
@shilch Why are you duplicating the comparator here?
If I didn't you would end in an infinite recursive loop because comparator would call itself.
@ -257,0 +319,4 @@
for _, param := range by {
comparator, ok := comparators[param.sortBy]
if !ok {
// TODO: Handle case that a suitable comparator has not been found
IMHO we could panic here, this is only an internal api. User validation input happens way earlier.
@ -37,0 +46,4 @@
sortProperty string
sortOrder bool
Any special resons why this is a bool? I know there can only be two types of sort orders, but a bool here is IMHO a bit overkill since bool has nothing to do with sort order.
What would you use instead? Note how it's not aliased but typed, i.e. you can not accidentally convert one to the other.
Makes sense, thanks for clarifying.
🎉