Skip to content

Commit

Permalink
rename API routes
Browse files Browse the repository at this point in the history
* change /parking_lots/$id -> /parkinglots/$id
  For symmetry with confd route

* remove collocutor from user's route
  /users/me/calls/$callid/collocutor/park -> /users/me/calls/$callid/park
  • Loading branch information
ja0x committed Mar 22, 2024
1 parent 351bd3b commit 1b0596b
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 6 deletions.
6 changes: 3 additions & 3 deletions wazo_calld/plugins/parking_lots/api.yml
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,7 @@ parameters:
schema:
$ref: '#/definitions/ParkCallBody'
paths:
/parking_lots/{parking_id}:
/parkinglots/{parking_id}:
get:
summary: Retrieve parked calls for parking
description: '**Required ACL:** `calld.parkings.{parking_id}.read`'
Expand Down Expand Up @@ -142,10 +142,10 @@ paths:
$ref: '#/responses/NotFoundError'
'503':
$ref: '#/responses/FullOrServiceUnavailable'
/users/me/calls/{call_id}/collocutor/park:
/users/me/calls/{call_id}/park:
put:
summary: Park the user's collocutor (talking to) call
description: '**Required ACL:** `calld.users.me.calls.{call_id}.collocutor.park.update`'
description: '**Required ACL:** `calld.users.me.calls.{call_id}.park.update`'
parameters:
- $ref: '#/parameters/TenantUUID'
- $ref: '#/parameters/CallID'
Expand Down
2 changes: 1 addition & 1 deletion wazo_calld/plugins/parking_lots/http.py
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ def put(self, call_id: str):


class UserCallParkResource(_Base):
@required_acl('calld.users.me.calls.{call_id}.collocutor.park.update')
@required_acl('calld.users.me.calls.{call_id}.park.update')
def put(self, call_id: str):
user_uuid: str = get_token_user_uuid_from_request()
request_data = park_call_request_schema.load(request.get_json(force=True))
Expand Down
4 changes: 2 additions & 2 deletions wazo_calld/plugins/parking_lots/plugin.py
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ def load(self, dependencies: Mapping) -> None:
def set_resources(self, api: Api, service: ParkingService) -> None:
api.add_resource(
ParkingLotResource,
'/parking_lots/<int:parking_id>',
'/parkinglots/<int:parking_id>',
resource_class_args=[service],
)

Expand All @@ -61,6 +61,6 @@ def set_resources(self, api: Api, service: ParkingService) -> None:

api.add_resource(
UserCallParkResource,
'/users/me/calls/<call_id>/collocutor/park',
'/users/me/calls/<call_id>/park',
resource_class_args=[service],
)

0 comments on commit 1b0596b

Please sign in to comment.