Beispiel #1
0
def update_cursor(chat_id, user_id):
    data = request.get_json()
    new_cursor = data.get("cursor")

    try:
        query = Participation.update(cursor=new_cursor).where(
            Participation.chat == chat_id, Participation.user == user_id)
        query.execute()
        return "", 204
    except Exception as e:
        return str(e), 400
Beispiel #2
0
def update_participant(chat_id, user_id):
    data = request.get_json()
    is_admin = data.get("is_admin")

    try:
        query = Participation.update(is_admin=is_admin).where(
            Participation.chat == chat_id, Participation.user == user_id)
        query.execute()
        return "", 204
    except Exception as e:
        return str(e), 400