mirror of
https://github.com/docusealco/docuseal
synced 2026-11-04 22:42:32 -05:00
fix api pagination
This commit is contained in:
1 parent
1d8e0417bd
commit
31f8057bfa
1 file changed
+2
-2
@@ -33,8 +33,8 @@ module Api
|
||||
result = relation.order(id: :desc)
|
||||
.limit([params.fetch(:limit, DEFAULT_LIMIT).to_i, MAX_LIMIT].min)
|
||||
|
||||
result = result.where('id < ?', params[:after]) if params[:after].present?
|
||||
result = result.where('id > ?', params[:before]) if params[:before].present?
|
||||
result = result.where(relation.arel_table[:id].lt(params[:after])) if params[:after].present?
|
||||
result = result.where(relation.arel_table[:id].gt(params[:before])) if params[:before].present?
|
||||
|
||||
result
|
||||
end
|
||||
|
||||
Reference in new issue
Block a user