shift-org / shift-docs

Shift2Bikes: website and calendar for shift and pedalpalooza
https://shift2bikes.org
Other
22 stars 17 forks source link

Add Api-Version to front end requests on list view and add/edit pages #748

Closed carrythebanner closed 5 months ago

carrythebanner commented 5 months ago

This is just informative for now; the server isn't doing anything based on this version yet, but may in the future.

ionous commented 5 months ago

looks good. seeing that main.js goes from $.get to $.ajax ( matching addevent.js ) gives me two thoughts:

  1. eventually, it'd be good to get away from jquery. what it does is mostly built-in these days. $.ajax for instance would probably be better (at some point) as fetch.

  2. it might be nice to give helpers.js some generic "post()" and "get()" functions. [ ex. maybe? something like post("manage_event", {id,secret}, data) ] and get("retrieve_event", {id, secret}) so that the code to add the headers api and other options can be shared, and all in one place