Island: Add some comments/TODOs to /api/island-mode

This commit is contained in:
Mike Salvatore 2022-07-22 08:48:17 -04:00
parent 46bcfe7619
commit 5e19abbe54
1 changed files with 4 additions and 1 deletions

View File

@ -12,12 +12,12 @@ logger = logging.getLogger(__name__)
class IslandMode(AbstractResource):
# API Spec: Instead of POST, this could just be PATCH
urls = ["/api/island-mode"]
def __init__(self, island_mode_service: IslandModeService):
self._island_mode_service = island_mode_service
# API Spec: Instead of POST, this should be PUT
@jwt_required
def post(self):
try:
@ -26,6 +26,9 @@ class IslandMode(AbstractResource):
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)
except (AttributeError, json.decoder.JSONDecodeError):
return make_response({}, 400)