@@ -15,7 +15,6 @@
|
||||
package types
|
||||
|
||||
import (
|
||||
"go.gearno.de/x/ref"
|
||||
"go.probo.inc/probo/pkg/page"
|
||||
"go.probo.inc/probo/pkg/server/gqlutils/types/cursor"
|
||||
)
|
||||
@@ -25,9 +24,9 @@ func NewCursor[O page.OrderField](
|
||||
after *page.CursorKey,
|
||||
orderBy page.OrderBy[O],
|
||||
) *page.Cursor[O] {
|
||||
firstValue := ref.Ref(100)
|
||||
firstValue := new(100)
|
||||
if first != nil {
|
||||
firstValue = ref.Ref(int(*first))
|
||||
firstValue = new(int(*first))
|
||||
}
|
||||
|
||||
return cursor.NewCursor(firstValue, after, nil, nil, orderBy)
|
||||
|
||||
@@ -15,7 +15,6 @@
|
||||
package pageinfo
|
||||
|
||||
import (
|
||||
"go.gearno.de/x/ref"
|
||||
"go.probo.inc/probo/pkg/page"
|
||||
)
|
||||
|
||||
@@ -33,8 +32,8 @@ func NewPageInfo[T page.Paginable[O], O page.OrderField](p *page.Page[T, O]) *Pa
|
||||
)
|
||||
|
||||
if len(p.Data) > 0 {
|
||||
startCursor = ref.Ref(p.First().CursorKey(p.Cursor.OrderBy.Field))
|
||||
endCursor = ref.Ref(p.Last().CursorKey(p.Cursor.OrderBy.Field))
|
||||
startCursor = new(p.First().CursorKey(p.Cursor.OrderBy.Field))
|
||||
endCursor = new(p.Last().CursorKey(p.Cursor.OrderBy.Field))
|
||||
}
|
||||
|
||||
return &PageInfo{
|
||||
|
||||
Reference in New Issue
Block a user