def get(): customers = customerHandler.get_customers() if customers: res = [c for c in customers if allow_viewing(c["id"]) and c.get("name") != "master"] statusHandler.set_status_for_customers(res) payload = {"customers": res} return OkResponse(payload) else: return NotFoundResponse("Could not find any customers")
def get(customer_id=None): res = customerHandler.get_customer(customer_id) if res: if type(res) == list: statusHandler.set_status_for_customers(res) else: statusHandler.set_status_for_customer(res) return OkResponse(res) else: return ConflictResponse("Could not get the customer")