This commit is contained in:
Satyabrata Mohanty 2025-03-11 20:42:26 +00:00 committed by GitHub
commit 6da3fe77f7
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 21 additions and 1 deletions

View file

@ -7,7 +7,10 @@ module Api
def index
@traces = current_user.traces.reload
render :content_type => "application/xml"
respond_to do |format|
format.xml { render :content_type => "application/xml" }
format.json { render :content_type => "application/json" }
end
end
end
end

View file

@ -0,0 +1,17 @@
json.gpx_files @traces do |trace|
json.id trace.id
json.name trace.name
json.uid trace.user_id
json.user trace.user.display_name
json.visibility trace.visibility
json.pending !trace.inserted
json.timestamp trace.timestamp.xmlschema
if trace.inserted
json.lat trace.latitude
json.lon trace.longitude
end
json.description trace.description
json.tags trace.tags.map(&:tag)
end