Skip to content

Commit

Permalink
Merge pull request #47 from nlb19/main
Browse files Browse the repository at this point in the history
Added save_attempt function
  • Loading branch information
lemeryfertitta authored Nov 13, 2024
2 parents 9877d2b + 777a19b commit f0abab7
Showing 1 changed file with 30 additions and 0 deletions.
30 changes: 30 additions & 0 deletions src/boardlib/api/aurora.py
Original file line number Diff line number Diff line change
Expand Up @@ -326,6 +326,36 @@ def save_ascent(
return response.json()


def save_attempt(
board,
token,
user_id,
climb_uuid,
angle,
is_mirror,
bid_count,
comment,
climbed_at,
):
uuid = generate_uuid()
response = requests.put(
f"{API_HOSTS[board]}/v1/bids/{uuid}",
headers={"authorization": f"Bearer {token}"},
json={
"user_id": user_id,
"uuid": uuid,
"climb_uuid": climb_uuid,
"angle": angle,
"is_mirror": is_mirror,
"bid_count": bid_count,
"comment": comment,
"climbed_at": climbed_at,
},
)
response.raise_for_status()
return response.json()


def save_climb(
board,
token,
Expand Down

0 comments on commit f0abab7

Please sign in to comment.