get all of your own positions
This commit is contained in:
parent
12a0db43e7
commit
ec61155833
1 changed files with 12 additions and 0 deletions
|
@ -295,6 +295,18 @@ def get_position_by_id(request, position_id: AnyPositionID):
|
|||
return location.serialize_position(request=request)
|
||||
|
||||
|
||||
@map_api_router.get('/positions/my/', summary="all moving position coordinates",
|
||||
description="get current coordinates of all moving positions owned be the current users",
|
||||
response={200: list[AnyPositionStatusSchema], **API404.dict(), **auth_responses})
|
||||
@api_stats('get_position')
|
||||
def get_my_positions(request, position_id: AnyPositionID):
|
||||
# no caching for obvious reasons!
|
||||
return [
|
||||
position.serialize_position(request=request)
|
||||
for position in Position.objects.filter(owner=request.user)
|
||||
]
|
||||
|
||||
|
||||
class UpdatePositionSchema(BaseSchema):
|
||||
coordinates_id: Union[
|
||||
Annotated[CustomLocationID, APIField(title="set coordinates")],
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue