Upgrade API - #341
Conversation
|
What doesn't work -- if you just replace the localStorage.getItem("added"); with the api call what happens? I feel like that should work... you will also have to make the function async and await and stuff but I dont see why that wouldn't work -- you also would have to update it throughout the file. You can walk me through it at some point, and we can try to debug |
|
In order to access the object we use to call the API, I need to be in a React hook/component, and I couldn't find a neat way to do that--not like I can just call the API directly with |
|
Ok that makes sense, I don't exactly know what to do, not super experienced with redux but I think that redux-thunk is the right way to do this... https://redux.js.org/tutorials/essentials/part-5-async-logic if you lmk the API calls you are actually trying to make I can try to hook everything up, but your try is as good as mine. |
|
I think it's TODO for myself: this code is horrible! Add the Redis client as a parameter to the CourseSchedulerController, rename unixID to userID, go through the rest and see what other stupid stuff I have done. |
|
Could also be |
|
Will need to also add API sync code to handle major builder state--so holding off on this PR until I go through the backend and API code and clean up my mess. Steps for this whole process:
This will be quite a headache. |
@mlaws21 trying to replace
localStorage.getItemandlocalStorage.setItemcalls inreducers/course.jswith wrappers to the API calls (wso.courseSchedulerService.setSelection()etc.) but I don't know if it is possible to refactor this without moving stuff to React hooks/components (and don't know the proper way to do so)