def api_chat(): offset = False if request.args.get('offset'): offset = request.args.get('offset') chats = fetch_chats(request, offset) return json.dumps(chats)
def api_chat(): offset = False if request.args.get('offset'): offset = request.args.get('offset') try: chats = fetch_chats(request, offset) except Exception as e: return str(e) return json.dumps(chats)