Optimize My Mentorship page by conditionally skipping GetMyPrograms query
- Dominant language
- Python
- Stars
- 451
- Forks
- 702
- Avg merge
- 22h 59m
- Merged PRs (30d)
- 91
Description
Community & Support: [LinkedIn Group](https://www.linkedin.com/groups/14656108/) · [Slack #project-nest](https://owasp.slack.com/archives/project-nest)
Active project leaders: Arkadii Yakovets -- [GitHub](https://github.com/arkid15r/) · [LinkedIn](https://www.linkedin.com/in/arkid15r/) · [Slack](https://owasp.slack.com/team/U060W3NKLTF); Kate Golovanova -- [GitHub](https://github.com/kasya/) · [LinkedIn](https://www.linkedin.com/in/kate-golovanova/) · [Slack](https://owasp.slack.com/team/U07PWB1JZ6Z)
[Contributing](https://github.com/owasp/nest/blob/main/CONTRIBUTING.md) · [Code of Conduct](https://github.com/owasp/nest/blob/main/CODE_OF_CONDUCT.md) · [GSoC Mentors](https://github.com/owasp/nest/blob/main/MENTORS.md)
---
**Describe the bug**
The My Mentorship portal (/my/mentorship) executes the GetMyPrograms query for every user when the page loads, even if the user is not a project leader.
Although the backend safely returns an empty response (programs: []), the request is still triggered unnecessarily.
**Current Behavior**
- GetMyPrograms runs on page load for all users
- Non-leader users still trigger the query
- Response returns an empty program list
**Expected behavior**
The query should only run when the user is a verified project leader, preventing unnecessary API calls for users who cannot access mentorship programs.
**Are you going to work on fixing this?**
- [x] Yes
- [ ] No
**Screenshots**
Contributor guide
Assessment
This issue has not been assessed yet.