Skip to content

[#13454] Refactor instructor search page to remove unnecessary API calls - #14409

Open
codigm wants to merge 3 commits into
TEAMMATES:masterfrom
codigm:refactor-instructor-search-privileges
Open

[#13454] Refactor instructor search page to remove unnecessary API calls#14409
codigm wants to merge 3 commits into
TEAMMATES:masterfrom
codigm:refactor-instructor-search-privileges

Conversation

@codigm

@codigm codigm commented Jul 25, 2026

Copy link
Copy Markdown

Fixes #13454

Outline of Solution

loadInstructorPrivilege was being called for each unique student section
instead of once per course, causing redundant API calls. Results also weren't
cached across searches.

Changes:

  • getPrivileges() now fetches once per unique courseId using forkJoin with
    a keyed Record instead of an unkeyed array
  • Added a privilegeCache Map to avoid re-fetching on subsequent searches
  • combinePrivileges() uses Map lookup by courseId instead of relying on
    forkJoin array ordering via shift()
  • Removed the TransformedInstructorSearchResult wrapper interface
  • Simplified the search() RxJS pipeline
  • Updated tests and added a caching test

@github-actions

github-actions Bot commented Jul 25, 2026

Copy link
Copy Markdown

Hi @codigm, all PR guideline checks have passed. Thank you for your contribution! 🎉

@codigm codigm changed the title Refactor instructor search page to remove unnecessary API calls (#13454) [#13454] Refactor instructor search page to remove unnecessary API calls Jul 25, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Refactor instructor search page to remove unnecessary api calls

1 participant