nidus-sync/resource/query_params.go
Eli Ribble 7f71ff9a2e
Send submit PUT on compliance report flow, create communication then
This makes it so that people don't see compliance reports as they're
being formulated in the communication workbench
2026-05-01 21:27:17 +00:00

29 lines
585 B
Go

package resource
import (
// "github.com/gorilla/schema"
)
type QueryParams struct {
Limit *int `schema:"limit"`
OrganizationID *int `schema:"org"`
Query *string `schema:"query"`
Sort *string `schema:"sort"`
Type *string `schema:"type"`
}
func (qp QueryParams) SortOrDefault(default_name string, ascending bool) (string, bool) {
if qp.Sort == nil {
return default_name, ascending
}
s := *qp.Sort
if s == "" {
return default_name, ascending
}
a := s[0] != '-'
if s[0] == '+' || s[0] == '-' {
s = s[1:]
}
return s, a
}