-
Notifications
You must be signed in to change notification settings - Fork 16
fix: fetching classes and class users separately, then aggregating students client-side #4737
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||||||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
|
@@ -129,8 +129,8 @@ const SubjectSelection: React.FC = () => { | |||||||||||||||||||||||||||||
| roles.includes(role), | ||||||||||||||||||||||||||||||
| ); | ||||||||||||||||||||||||||||||
| setCanModify( | ||||||||||||||||||||||||||||||
| schoolMatches && | ||||||||||||||||||||||||||||||
| (normalizedRole === RoleType.PRINCIPAL || hasSubjectModificationRole), | ||||||||||||||||||||||||||||||
| hasSubjectModificationRole || | ||||||||||||||||||||||||||||||
| (schoolMatches && normalizedRole === RoleType.PRINCIPAL), | ||||||||||||||||||||||||||||||
| ); | ||||||||||||||||||||||||||||||
|
Comment on lines
129
to
134
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The Using optional chaining
Suggested change
|
||||||||||||||||||||||||||||||
| }, [currentSchool?.id, paramSchoolId, roleMap, roles]); | ||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This new code makes every campaign audience summary depend on the
get_campaign_audience_summaryRPC, but this commit only adds the TypeScript declaration; a repo-widerg "get_campaign_audience_summary"finds no SQL/migration/function definition outside this call and the type entry. In any environment that has not had this function created manually, Supabase will return an RPC-not-found error, this method falls back to{ totalStudents: 0, grades: [] }, and the campaign setup UI treats the selected audience as having 0 students and blocks progression. Please include the DB function/migration or keep the client-side path until the RPC is deployed.Useful? React with 👍 / 👎.