Refactor model cursor to use orderBy
Signed-off-by: gearnode <bryan@frimin.fr>
This commit is contained in:
@@ -21,6 +21,7 @@ import (
|
||||
"time"
|
||||
|
||||
"github.com/getprobo/probo/pkg/gid"
|
||||
"github.com/getprobo/probo/pkg/page"
|
||||
"github.com/jackc/pgx/v5"
|
||||
"go.gearno.de/kit/pg"
|
||||
)
|
||||
@@ -38,6 +39,10 @@ type (
|
||||
Organizations []*Organization
|
||||
)
|
||||
|
||||
func (o Organization) CursorKey(orderBy page.OrderField) page.CursorKey {
|
||||
return page.NewCursorKey(o.ID, o.CreatedAt)
|
||||
}
|
||||
|
||||
func (o *Organization) LoadByID(
|
||||
ctx context.Context,
|
||||
conn pg.Conn,
|
||||
|
||||
Reference in New Issue
Block a user