forked from p15670423/monkey
Island: Add some comments/TODOs to /api/island-mode
This commit is contained in:
parent
46bcfe7619
commit
5e19abbe54
|
@ -12,12 +12,12 @@ logger = logging.getLogger(__name__)
|
||||||
|
|
||||||
|
|
||||||
class IslandMode(AbstractResource):
|
class IslandMode(AbstractResource):
|
||||||
# API Spec: Instead of POST, this could just be PATCH
|
|
||||||
urls = ["/api/island-mode"]
|
urls = ["/api/island-mode"]
|
||||||
|
|
||||||
def __init__(self, island_mode_service: IslandModeService):
|
def __init__(self, island_mode_service: IslandModeService):
|
||||||
self._island_mode_service = island_mode_service
|
self._island_mode_service = island_mode_service
|
||||||
|
|
||||||
|
# API Spec: Instead of POST, this should be PUT
|
||||||
@jwt_required
|
@jwt_required
|
||||||
def post(self):
|
def post(self):
|
||||||
try:
|
try:
|
||||||
|
@ -26,6 +26,9 @@ class IslandMode(AbstractResource):
|
||||||
|
|
||||||
self._island_mode_service.set_mode(mode)
|
self._island_mode_service.set_mode(mode)
|
||||||
|
|
||||||
|
# TODO: Do any of these returns need a body and make_response? What happens if we just
|
||||||
|
# return the response code?
|
||||||
|
# API Spec: This should be 204 (NO CONTENT)
|
||||||
return make_response({}, 200)
|
return make_response({}, 200)
|
||||||
except (AttributeError, json.decoder.JSONDecodeError):
|
except (AttributeError, json.decoder.JSONDecodeError):
|
||||||
return make_response({}, 400)
|
return make_response({}, 400)
|
||||||
|
|
Loading…
Reference in New Issue