Skip to content

Commit

Permalink
fix(dashboard): sort slices with proper data
Browse files Browse the repository at this point in the history
Didn't notice that I sorted empty slices, not the ones holding the data.
  • Loading branch information
vednoc committed Aug 9, 2021
1 parent 83b2de4 commit 7e82111
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions handlers/core/dashboard.go
Original file line number Diff line number Diff line change
Expand Up @@ -150,8 +150,8 @@ func Dashboard(c *fiber.Ctx) error {
})
}

sort.Slice(styles, func(i, j int) bool {
return styles[i].ID > styles[j].ID
sort.Slice(s, func(i, j int) bool {
return s[i].ID > s[j].ID
})

styles = s
Expand All @@ -168,8 +168,8 @@ func Dashboard(c *fiber.Ctx) error {
})
}

sort.Slice(users, func(i, j int) bool {
return users[i].ID > users[j].ID
sort.Slice(u, func(i, j int) bool {
return u[i].ID > u[j].ID
})

users = u
Expand Down

0 comments on commit 7e82111

Please sign in to comment.