unitedworldwrestling / arena-public

14 stars 5 forks source link

I can't add atheletes to the event using Add a athlete endpoint. How to add weight category? #174

Closed antohasv closed 2 weeks ago

antohasv commented 2 weeks ago

Which application you are experiencing a problem with Arena

Describe the bug I use API endpoints: https://arena.sportrec.online/api/doc/

To Reproduce Steps to reproduce the behavior:

  1. Go to and run Post /api/json/athlete/{sportEventId}

Expected behavior The athlete doesn't add to the event

csabavirag commented 2 weeks ago

Have you tried to use the collection + environment import into Postman and create the desired API call from the examples? https://github.com/unitedworldwrestling/arena-public/tree/master/Resources/Postman

antohasv commented 2 weeks ago

Hey @csabavirag

Thank you for your quick reply! Here is a quick video: https://www.loom.com/share/65b96d67a8314a12aeb98cd383f0be47

I still have the issue to add Athletes using API.

csabavirag commented 2 weeks ago

You stopped at 2.i from my other comment at https://github.com/unitedworldwrestling/arena-public/issues/175#issuecomment-2178598797

You just created an athlete, but it's not associated with any weight category. It's important to call 2.ii (create fighter), where you can do this association.

As you can see, the Location header attribute of the Create Athlete (POST /api/json/athlete/{{sportEventId}}) contains the athleteID of the newly created athlete. This athleteID must be passed to the Create Fighter (POST /api/json/fighter/{{athleteID}}) endpoint to assign a weight category to this athlete.

image
antohasv commented 2 weeks ago

@csabavirag thanks