-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #100 from whyphi/bug/update-listing-settings
Bug/update listing settings
- Loading branch information
Showing
5 changed files
with
25 additions
and
20 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,68 +1,69 @@ | ||
from chalice import Blueprint | ||
from chalicelib.decorators import auth | ||
from chalicelib.services.EventsMemberService import events_member_service | ||
from chalicelib.models.roles import Roles | ||
|
||
events_member_api = Blueprint(__name__) | ||
|
||
|
||
@events_member_api.route("/timeframes", methods=["POST"], cors=True) | ||
@auth(events_member_api, roles=["admin"]) | ||
@auth(events_member_api, roles=[Roles.ADMIN]) | ||
def create_timeframe(): | ||
data = events_member_api.current_request.json_body | ||
return events_member_service.create_timeframe(data) | ||
|
||
|
||
@events_member_api.route("/timeframes", methods=["GET"], cors=True) | ||
@auth(events_member_api, roles=["admin"]) | ||
@auth(events_member_api, roles=[Roles.ADMIN, Roles.MEMBER]) | ||
def get_all_timeframes(): | ||
return events_member_service.get_all_timeframes() | ||
|
||
|
||
@events_member_api.route("/timeframes/{timeframe_id}", methods=["GET"], cors=True) | ||
@auth(events_member_api, roles=["admin"]) | ||
@auth(events_member_api, roles=[Roles.ADMIN, Roles.MEMBER]) | ||
def get_timeframe(timeframe_id: str): | ||
return events_member_service.get_timeframe(timeframe_id) | ||
|
||
|
||
@events_member_api.route("/timeframes/{timeframe_id}", methods=["DELETE"], cors=True) | ||
@auth(events_member_api, roles=["admin"]) | ||
@auth(events_member_api, roles=[Roles.ADMIN]) | ||
def delete_timeframe(timeframe_id: str): | ||
return events_member_service.delete_timeframe(timeframe_id) | ||
|
||
|
||
@events_member_api.route("/timeframes/{timeframe_id}/events", methods=["POST"], cors=True) | ||
@auth(events_member_api, roles=["admin"]) | ||
@auth(events_member_api, roles=[Roles.ADMIN]) | ||
def create_event(timeframe_id: str): | ||
data = events_member_api.current_request.json_body | ||
return events_member_service.create_event(timeframe_id, data) | ||
|
||
|
||
@events_member_api.route("/events/{event_id}", methods=["GET"], cors=True) | ||
@auth(events_member_api, roles=["admin"]) | ||
@auth(events_member_api, roles=[Roles.ADMIN, Roles.MEMBER]) | ||
def get_event(event_id: str): | ||
return events_member_service.get_event(event_id) | ||
|
||
|
||
@events_member_api.route("/timeframes/{timeframe_id}/sheets", methods=["GET"], cors=True) | ||
@auth(events_member_api, roles=["admin"]) | ||
@auth(events_member_api, roles=[Roles.ADMIN, Roles.MEMBER]) | ||
def get_timeframe_sheets(timeframe_id: str): | ||
return events_member_service.get_timeframe_sheets(timeframe_id) | ||
|
||
|
||
@events_member_api.route("/events/{event_id}/checkin", methods=["POST"], cors=True) | ||
@auth(events_member_api, roles=["admin"]) | ||
@auth(events_member_api, roles=[Roles.ADMIN, Roles.MEMBER]) | ||
def checkin(event_id: str): | ||
data = events_member_api.current_request.json_body | ||
return events_member_service.checkin(event_id, data) | ||
|
||
|
||
@events_member_api.route("/events/{event_id}", methods=["PATCH"], cors=True) | ||
@auth(events_member_api, roles=["admin"]) | ||
@auth(events_member_api, roles=[Roles.ADMIN]) | ||
def update_event(event_id: str): | ||
pass | ||
|
||
|
||
@events_member_api.route("/events/{event_id}", methods=["DELETE"], cors=True) | ||
@auth(events_member_api, roles=["admin"]) | ||
@auth(events_member_api, roles=[Roles.ADMIN]) | ||
def delete_event(event_id: str): | ||
return events_member_service.delete(event_id) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters