add simple api to view the current changeset
This commit is contained in:
parent
7bad785155
commit
1d6ce7179d
2 changed files with 35 additions and 0 deletions
|
@ -15,6 +15,7 @@ class EditorViewSet(ViewSet):
|
|||
Editor API
|
||||
/geometries/ returns a list of geojson features, you have to specify ?level=<id> or ?space=<id>
|
||||
/geometrystyles/ returns styling information for all geometry types
|
||||
/changeset/ returns the current changeset
|
||||
"""
|
||||
def _get_level_geometries(self, level):
|
||||
buildings = level.buildings.all()
|
||||
|
@ -153,3 +154,9 @@ class EditorViewSet(ViewSet):
|
|||
'point': '#4488cc',
|
||||
'shadow': '#000000',
|
||||
})
|
||||
|
||||
@list_route(methods=['get'])
|
||||
def changeset(self, request, *args, **kwargs):
|
||||
request.changeset = ChangeSet.get_for_request(request)
|
||||
|
||||
return Response(request.changeset.serialize())
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue