Skip to content
This repository was archived by the owner on Nov 7, 2024. It is now read-only.
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 18 additions & 0 deletions app/core/views/admin_views.py
Original file line number Diff line number Diff line change
Expand Up @@ -214,3 +214,21 @@ def update_milestone():
)
else:
return jsonify({"error": "Failed to update user data."}), 500


@core.route("/getHistoryCounts/<userAddress>", methods=["GET"])
def get_all_history_count_for_address(userAddress):
try:
if not userAddress:
return jsonify({"error": "Address is required"}), 400

count = get_history_count(userAddress)
if not count:
return (
jsonify({"error": "Can't find any history with this given address"}),
200,
)

return jsonify({"Counts": count}), 200
except Exception as e:
return jsonify({"error": str(e)}), 500