navgurukul / bhanwari-devi

Frontend Repository for Merakilearn maintained by Navgurukul students and volunteers
https://www.merakilearn.org/
31 stars 17 forks source link

Perf/Prevent some repeat API requests #1036

Closed jschanker closed 1 year ago

jschanker commented 1 year ago

Which issue does this refer to ? Removes unnecessary (repeat) requests to /pathways/dropdown, /pathways/{pathwayId}/courses, and teacher/checking.

Brief description of the changes done

  1. Moved action dispatch to make API requests to /pathways/dropdown from Header and Footer, to parent App component.
  2. Split pathway saga generator function into two: one to handle the GET_PATHWAY_DROPDOWN_INTENT actions that are dispatched, and one for all the others. Then we could import them separately for use in the root saga to avoid the double requests for each action resulting from forking the same function twice.
  3. Removed unnecessary dispatches/API requests that would unnecessarily call /pathways/{pathwayId}/courses where the data wasn't being used.
  4. Removed unnecessary dependencies in useEffect with function making API request to teacher/checking that caused unnecessary repeats of this API request.

People to loop in / review from @komalahire

vercel[bot] commented 1 year ago

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
bhanwari-devi ✅ Ready (Inspect) Visit Preview 💬 Add feedback Aug 5, 2023 1:16pm
bhanwari-devi-old ✅ Ready (Inspect) Visit Preview 💬 Add feedback Aug 5, 2023 1:16pm
meraki-dev ✅ Ready (Inspect) Visit Preview 💬 Add feedback Aug 5, 2023 1:16pm
sonarcloud[bot] commented 1 year ago

Kudos, SonarCloud Quality Gate passed!    Quality Gate passed

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell A 21 Code Smells

No Coverage information No Coverage information
0.0% 0.0% Duplication