I am working on a Flask + ReactJs project and in my flask api getting this error: AttributeError: ‘Employee’ object has no attribute ‘append’ [closed]

Solution
@app.route("/employee")
def employee():
    employee_list = Employee.query.all()
    employees = [] # <--- changed from `employee` to `employees`
    for employee in employee_list:
        employee.append({'id' : employee.id,
                        'name' : employee.name,
                        'email' : employee.email,
                        'contact' : employee.contact,
                        'designation' : employee.designation})
    return jsonify({'employee' : employee}) # <--- changed from `employee` to `employees`