Skip to content

Commit

Permalink
fix: add missing sorting parameter to REST API call and test
Browse files Browse the repository at this point in the history
  • Loading branch information
spacehamster87 committed Dec 17, 2024
1 parent 9248ee8 commit ee2c5b5
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion internal/api/rest.go
Original file line number Diff line number Diff line change
Expand Up @@ -341,7 +341,7 @@ func (api *RestApi) getJobs(rw http.ResponseWriter, r *http.Request) {
withMetadata := false
filter := &model.JobFilter{}
page := &model.PageRequest{ItemsPerPage: 25, Page: 1}
order := &model.OrderByInput{Field: "startTime", Order: model.SortDirectionEnumDesc}
order := &model.OrderByInput{Field: "startTime", Type: "col", Order: model.SortDirectionEnumDesc}

for key, vals := range r.URL.Query() {
switch key {
Expand Down
2 changes: 1 addition & 1 deletion internal/repository/repository_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,7 @@ func BenchmarkDB_QueryJobs(b *testing.B) {
user := "mppi133h"
filter.User = &model.StringInput{Eq: &user}
page := &model.PageRequest{ItemsPerPage: 50, Page: 1}
order := &model.OrderByInput{Field: "startTime", Order: model.SortDirectionEnumDesc}
order := &model.OrderByInput{Field: "startTime", Type: "col", Order: model.SortDirectionEnumDesc}

b.Run("QueryJobs", func(b *testing.B) {
db := setup(b)
Expand Down

0 comments on commit ee2c5b5

Please sign in to comment.