Example #1
0
def register():
    conn = db_acc.account(con_db)
    data = request.json
    sheet = acc.account(
        1,
        data["email"],
        data["password"],
        data["nameUser"],
        data["dateOfBirth"],
        data["adress"],
        data["company"],
    )
    result = conn.insert(sheet)
    return jsonify({"data": result}), 200
Example #2
0
def updateInfo():
    conn = db_acc.account(con_db)
    data = request.json
    sheet = acc.account(
        data["idOfUser"],
        data["email"],
        data["password"],
        data["nameUser"],
        data["dateOfBirth"],
        data["adress"],
        data["company"],
    )
    result = conn.update(sheet)
    return jsonify({"data": result}), 200
Example #3
0
def getAccount():
    result = db_acc.account(con_db).getAccount()
    return jsonify({"data": result}), 200
Example #4
0
def getAccById():
    data = request.json
    result = db_acc.account(con_db).getAccById(data["idOfUser"])
    return jsonify({"data": result}), 200
Example #5
0
def login():
    conn = db_acc.account(con_db)
    data = request.json
    result = conn.getLogin(data["email"], data["password"])
    return jsonify({"data": result}), 200