Beispiel #1
0
def emp_update():
    values = json.loads(request.form['params'])
    empid = values['id']
    try:
        numrows = Employee.update(values)
        if numrows != 1:
            msg = 'Record not updated for unknown reason. Contact admin.'
            return jsonify(error=msg)
    except Exception as ex:
        return jsonify(error=str(ex))
    return jsonify(empid=empid, employees=Employee.get_all())
Beispiel #2
0
async def update_employee(employee: Employee):
    employee.update(id)
    return employee