mirror of
https://github.com/ClusterCockpit/cc-backend
synced 2024-12-25 12:59:06 +01:00
fix: add missing sorting parameter to REST API call and test
This commit is contained in:
parent
9248ee8868
commit
ee2c5b58d7
@ -341,7 +341,7 @@ func (api *RestApi) getJobs(rw http.ResponseWriter, r *http.Request) {
|
|||||||
withMetadata := false
|
withMetadata := false
|
||||||
filter := &model.JobFilter{}
|
filter := &model.JobFilter{}
|
||||||
page := &model.PageRequest{ItemsPerPage: 25, Page: 1}
|
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() {
|
for key, vals := range r.URL.Query() {
|
||||||
switch key {
|
switch key {
|
||||||
|
@ -111,7 +111,7 @@ func BenchmarkDB_QueryJobs(b *testing.B) {
|
|||||||
user := "mppi133h"
|
user := "mppi133h"
|
||||||
filter.User = &model.StringInput{Eq: &user}
|
filter.User = &model.StringInput{Eq: &user}
|
||||||
page := &model.PageRequest{ItemsPerPage: 50, Page: 1}
|
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) {
|
b.Run("QueryJobs", func(b *testing.B) {
|
||||||
db := setup(b)
|
db := setup(b)
|
||||||
|
Loading…
Reference in New Issue
Block a user