Skip to content

Handle disabled classes API - #5

Draft
Mahin2076 wants to merge 2 commits into
r58Playz:mainfrom
Mahin2076:agent/handle-disabled-classes-api
Draft

Handle disabled classes API#5
Mahin2076 wants to merge 2 commits into
r58Playz:mainfrom
Mahin2076:agent/handle-disabled-classes-api

Conversation

@Mahin2076

Copy link
Copy Markdown

What changed

  • Validate that the My Classes API response is an array before rendering it.
  • Show the API-provided disabled message for MYCLASSES_DISABLED/403 responses.
  • Surface unexpected API responses through the existing error layout.
  • Treat a missing teachers field as an empty list.

Why

When a district disables My Classes, the endpoint returns an error object instead of an array. The Classes view passed that object to .map(), producing TypeError: t.map is not a function and hiding the useful API error.

Impact

Users now see a clear administrator-disabled notice instead of a runtime crash. Valid class responses continue rendering normally. This does not bypass tenant restrictions or expose disabled schedule data.

Validation

  • pnpm build
  • git diff --check

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.

1 participant