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

@@ -47,7 +47,7 @@ type (
}
)
func (f Framework) CursorKey() page.CursorKey {
func (f Framework) CursorKey(orderBy page.OrderField) page.CursorKey {
return page.NewCursorKey(f.ID, f.CreatedAt)
}
@@ -78,7 +78,7 @@ WHERE
q = fmt.Sprintf(q, scope.SQLFragment(), cursor.SQLFragment())
args := pgx.StrictNamedArgs{"organization_id": organizationID}
args := pgx.NamedArgs{"organization_id": organizationID}
maps.Copy(args, scope.SQLArguments())
maps.Copy(args, cursor.SQLArguments())