diff --git a/api/api.py b/api/api.py index 8c6a657..e651b87 100644 --- a/api/api.py +++ b/api/api.py @@ -132,28 +132,32 @@ def get(self, queue: str, number: int) -> tuple: item (int): The number of the item requested. Returns: - tuple: Response containing queue as JSON and HTTP response code. + tuple: Item as JSON and HTTP response code. """ return (ECNQueue.Item(queue, number).toJson(), 200) class Queue(Resource): @jwt_required - def get(self, queue: str) -> str: + def get(self, queues: str) -> tuple: """Returns the JSON representation of the queue requested. + Return Codes: + 200 (OK): On success. + 500 (Internal Server Error): On API error. + Args: - queue (str): The queue requested. + queues (str): Plus (+) deliminited list of queues. Returns: - str: JSON representation of the queue requested. + tuple: Queues as JSON and HTTP response code. """ - queues_requested = queue.split("+") + queues_requested = queues.split("+") - queues = [] + queue_list = [] for queue in queues_requested: - queues.append(ECNQueue.Queue(queue).toJson()) + queue_list.append(ECNQueue.Queue(queue).toJson()) - return queues + return (queues, 200) class QueueList(Resource): @jwt_required