Skip to content

Commit

Permalink
fix: search parameter scope
Browse files Browse the repository at this point in the history
  • Loading branch information
katallaxie authored Aug 20, 2024
1 parent f2e9a8e commit 015e738
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions components/tables/tables.go
Original file line number Diff line number Diff line change
Expand Up @@ -177,9 +177,8 @@ func PaginatedResults[T any](value interface{}, pagination *Results[T], db *gorm
totalPages := int(math.Ceil(float64(totalRows) / float64(pagination.Limit)))
pagination.TotalPages = totalPages

db.Scopes(searchScope(pagination))

return func(db *gorm.DB) *gorm.DB {
db = db.Scopes(searchScope(pagination))
return db.Offset(pagination.GetOffset()).Limit(pagination.GetLimit())
}
}
Expand Down

0 comments on commit 015e738

Please sign in to comment.