Update paginated responses to include summary data

This commit is contained in:
2025-10-08 07:59:45 -07:00
parent 1285f95ad3
commit 3db7db9624
5 changed files with 30 additions and 17 deletions

View File

@@ -3,7 +3,12 @@ module Api::V1::Parks
before_action :set_park
def index
render json: @park.alerts.limit(per_page).offset((page - 1) * per_page)
render json: {
total: @park.alerts.count,
limit: pagination_limit,
offset: pagination_offset,
alerts: @park.alerts.limit(pagination_limit).offset(pagination_offset)
}
end
end
end