How to update a specific table of a webpage in flask?

Solution


{{ transaction.get('date').strftime("%d %B, %Y") }}
{{ transaction.get('pcount') }}
{{ transaction.get('pcompleted') }}
{{ transaction.get('pfailed') }}

@app.route('/table-refresh', methods=['GET'])
def table_refresh():
    # [[id, date, pcount, pcompleted, pfailed], ...]
    arr = [[1, '2021-08-23', 1, 1, 1], [2, '2021-08-24', 1, 1, 1]]
    return jsonify(arr)