mirror of
https://github.com/Freika/dawarich.git
synced 2026-01-11 17:51:39 -05:00
* Add tracks to map v2 * Remove console log * Update tracks generation behavior to ignore distance threshold for frontend parity * Extract logic to services from TracksController#index and add tests * Move query logic for track listing into a service object.
16 lines
446 B
Ruby
16 lines
446 B
Ruby
# frozen_string_literal: true
|
|
|
|
class Api::V1::TracksController < ApiController
|
|
def index
|
|
tracks_query = Tracks::IndexQuery.new(user: current_api_user, params: params)
|
|
paginated_tracks = tracks_query.call
|
|
|
|
geojson = Tracks::GeojsonSerializer.new(paginated_tracks).call
|
|
|
|
tracks_query.pagination_headers(paginated_tracks).each do |header, value|
|
|
response.set_header(header, value)
|
|
end
|
|
|
|
render json: geojson
|
|
end
|
|
end
|