Refactor model cursor to use orderBy

Signed-off-by: gearnode <bryan@frimin.fr>
This commit is contained in:
gearnode
2025-03-18 18:16:14 +01:00
parent 709b3363c5
commit c73e417e5c
24 changed files with 300 additions and 94 deletions

View File

@@ -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,