remove cursor logic from ToLinkURL()

This commit is contained in:
kim 2024-04-30 13:34:37 +01:00
parent eeb3e8bc60
commit d099403a22

View file

@ -283,27 +283,14 @@ func (p *Page) ToLinkURL(proto, host, path string, queryParams url.Values) *url.
queryParams = cloneQuery(queryParams)
}
var cursor string
// Depending on page ordering, the
// page will be cursored by either
// the min or max query parameter.
if p.order().Ascending() {
cursor = p.Min.Name
} else {
cursor = p.Max.Name
if p.Min.Value != "" {
// Set page-minimum cursor value.
queryParams.Set(p.Min.Name, p.Min.Value)
}
if cursor != "" {
if p.Min.Value != "" {
// Set page-minimum cursor value.
queryParams.Set(cursor, p.Min.Value)
}
if p.Max.Value != "" {
// Set page-maximum cursor value.
queryParams.Set(cursor, p.Max.Value)
}
if p.Max.Value != "" {
// Set page-maximum cursor value.
queryParams.Set(p.Max.Name, p.Max.Value)
}
if p.Limit > 0 {