VATUSA / api

VATUSA's RESTful API for facilities
https://api.vatusa.net
MIT License
3 stars 10 forks source link

[BUG] Submit Training Records rejects valid callsigns #89

Open asherrobinson opened 2 years ago

asherrobinson commented 2 years ago

Contact Details

wm@nyartcc.org

What happened?

When using the API to submit training records, requests are rejected if they don't match an (unnecessarily restrictive) regex. This regex does not currently account for all valid position identifiers. The most recent example from our facility is as follows:

Jul 13, 2022 
Type Checkout
Position NY_66_CTR
Progression ★★★★
Venue Sweatbox
Dur. 60
Mvmts. 20

I believe the relevant code is in App\Http\Controllers\API\v2\TrainingController, in a number of places in the various record creation/modification methods. I'd suggest modifying this regex to allow all valid callsigns, so that valid training records stop getting rejected.

What endpoint was being used?

POST https://api.vatusa.net/v2/user/{cid}/training/record

What error response was returned (if applicable)?

{"data":{"status":"error","msg":"Invalid position."},"testing":false}

Screenshots

No response