Open khomtali opened 4 years ago
Hey @khomtali I'm a bit confused already includes types no? https://btbtravis.github.io/redi-run-api/#/default/get_trainings
As far as the cross referencing of fields I think would best to do this on the frontend. Directly after you fetch the training data you can parse it into the structure you app needs.
Hey @khomtali I'm a bit confused already includes types no? https://btbtravis.github.io/redi-run-api/#/default/get_trainings
yes, sure. My idea was to upload only types without other info. I would like to upload training plans only after user presses 'configure' button on training tab. Maybe the best solution will be just to create a constant for types description.
You may want to make the fetch call as the app loads then store the results somewhere. Then as user browser the app the info will be ready and you can display parts of the data such as types earlier then full training plan later. I think it will be smoother because the data will be instantly there when switching tabs vs switching tabs and having to wait for another server call.
Also I noticed the first training data request every minute is quite slow. This is because the backend has to do several calls to airtable and there is a rate limit. After it calls it stores the result in cache for a minute. So the next call is near instant. If you want this to be faster please create a backend issue and I'll think of a way to improve it. We could have longer cache for example or setup a cron to call airtable every 30min and make the cache 30min...
I'm not a fan of hard coding the types because is possible for the data to change in airtable and then code changes would be needed...
Hi @BTBTravis In airtable there are 3 tables:
The third one I need only for collapsable descriptions (plan to do one more
Route
for it withpath="/training/info"
, because together with training plan will be too much information for one page). So if you could do another endpoint for that table, it would be great. Or I can create a constant for that informations such as a const with zones descriptions.About plans, in PR #34 I've added two
select
forms and I would like to send its values to backend to get the right training plan. Could you please also implement this opportunity instead of returning all the table? Is it possible in air table? Then as I see that a link in airtable (ex fieldTraining 1
) to the right training I receive as a key to the second table. And I don't understand how it can help me to get info about this training from the 2nd table... Is it possible to have instead of this key an object of this training under the fieldsTraining 1
andTraining 2
?Alternative
is not so crucial because if it exists it's always a cross-training.