Skip to content

Added API to get the schools related to USer#4739

Merged
bhanugummana merged 1 commit into
mainfrom
vinay-main
Jul 16, 2026
Merged

Added API to get the schools related to USer#4739
bhanugummana merged 1 commit into
mainfrom
vinay-main

Conversation

@vinaypanduga

Copy link
Copy Markdown
Collaborator

No description provided.

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex usage limits have been reached for code reviews. Please check with the admins of this repo to increase the limits by adding credits.
Credits must be used to enable repository wide code reviews.

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request splits the combined logic for the PROGRAM_MANAGER and FIELD_COORDINATOR roles in SupabaseApi.ts. A dedicated block is introduced for FIELD_COORDINATOR to query the SchoolUser table, filter, sort, and paginate the results. The review feedback suggests a minor performance optimization to convert the search query to lowercase outside of the loop instead of on every iteration.

Important

The consumer version of Gemini Code Assist on GitHub is being sunset. Starting June 18, 2026, new organization installations will be blocked, and all code review activity will officially cease on July 17, 2026.
For more details on the timeline and next steps, please review the Help Documentation.

Comment on lines +3848 to +3859
for (const row of schoolUsers ?? []) {
const school = firstOrSelf(row.school);
if (
!school?.id ||
school.is_deleted ||
(search &&
!String(school.name ?? '')
.toLowerCase()
.includes(search.toLowerCase()))
) {
continue;
}

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

To improve efficiency, consider converting the search string to lowercase once outside the loop instead of calling search.toLowerCase() on every iteration.

        const searchLower = search?.toLowerCase();
        for (const row of schoolUsers ?? []) {
          const school = firstOrSelf(row.school);
          if (
            !school?.id ||
            school.is_deleted ||
            (searchLower &&
              !String(school.name ?? '')
                .toLowerCase()
                .includes(searchLower))
          ) {
            continue;
          }

@bhanugummana
bhanugummana merged commit 1f52dc7 into main Jul 16, 2026
1 check passed
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.

2 participants