Fix column name when detecting order by (#3978)

This commit is contained in:
Martin Angers 2022-02-02 10:08:51 -05:00 committed by GitHub
parent a63c549f07
commit 6319812984
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -323,7 +323,7 @@ func selectSoftwareSQL(hostID *uint, opts fleet.SoftwareListOptions) (string, []
)
subSelectListOpts := opts.ListOptions
switch subSelectListOpts.OrderKey {
case "hosts_counts", "counts_updated_at":
case "hosts_count", "counts_updated_at":
// all good, known columns, so we sort
subSelectCounts = appendListOptionsToSelect(subSelectCounts, opts.ListOptions)
default: