mirror of
https://github.com/bitechdev/ResolveSpec.git
synced 2026-03-13 00:46:50 +00:00
Compare commits
1 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
7dd630dec2 |
@@ -329,6 +329,11 @@ func (h *Handler) handleRead(ctx context.Context, w common.ResponseWriter, id st
|
|||||||
// Extract model columns for validation
|
// Extract model columns for validation
|
||||||
modelColumns := reflection.GetModelColumns(model)
|
modelColumns := reflection.GetModelColumns(model)
|
||||||
|
|
||||||
|
// Default sort to primary key when none provided
|
||||||
|
if len(options.Sort) == 0 {
|
||||||
|
options.Sort = []common.SortOption{{Column: pkName, Direction: "ASC"}}
|
||||||
|
}
|
||||||
|
|
||||||
// Get cursor filter SQL
|
// Get cursor filter SQL
|
||||||
cursorFilter, err := GetCursorFilter(tableName, pkName, modelColumns, options)
|
cursorFilter, err := GetCursorFilter(tableName, pkName, modelColumns, options)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
|
|||||||
@@ -731,6 +731,11 @@ func (h *Handler) handleRead(ctx context.Context, w common.ResponseWriter, id st
|
|||||||
// For now, pass empty map as joins are handled via Preload
|
// For now, pass empty map as joins are handled via Preload
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Default sort to primary key when none provided
|
||||||
|
if len(options.Sort) == 0 {
|
||||||
|
options.Sort = []common.SortOption{{Column: pkName, Direction: "ASC"}}
|
||||||
|
}
|
||||||
|
|
||||||
// Get cursor filter SQL
|
// Get cursor filter SQL
|
||||||
cursorFilter, err := options.GetCursorFilter(tableName, pkName, modelColumns, expandJoins)
|
cursorFilter, err := options.GetCursorFilter(tableName, pkName, modelColumns, expandJoins)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
|
|||||||
Reference in New Issue
Block a user