Fixed SingleRecordAsObject true when handleRead with no id

This commit is contained in:
Hein
2025-11-21 11:49:08 +02:00
parent 02c9b96b0c
commit 76bbf33db2
3 changed files with 12 additions and 4 deletions

View File

@@ -267,7 +267,7 @@ func (h *Handler) parseOptionsFromHeaders(r common.Request, model interface{}) E
h.resolveRelationNamesInOptions(&options, model)
}
//Always sort according to the primary key if no sorting is specified
// Always sort according to the primary key if no sorting is specified
if len(options.Sort) == 0 {
pkName := reflection.GetPrimaryKeyName(model)
options.Sort = []common.SortOption{{Column: pkName, Direction: "ASC"}}