mirror of
https://github.com/Freika/dawarich.git
synced 2026-01-12 10:11:38 -05:00
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
|