Skip to content
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

getGoals on [goal_id].tsx page needs to use isLoading #485

Open
canjalal opened this issue Dec 23, 2024 · 0 comments
Open

getGoals on [goal_id].tsx page needs to use isLoading #485

canjalal opened this issue Dec 23, 2024 · 0 comments
Labels
bug Something isn't working

Comments

@canjalal
Copy link
Contributor

In [goal_id].tsx, we have the following code:

  const { data: activeIep } = trpc.student.getActiveStudentIep.useQuery(
    { student_id: student_id },
    { enabled: Boolean(student_id), retry: false }
  );
  const { data: goals = [] } = trpc.iep.getGoals.useQuery({
    iep_id: activeIep?.iep_id || "",
  });

When getGoals is launched with iep_id being '', then we get an error because iep_id cannot be an empty string. We need to handle this.

Expected:
We should wait until the activeStudentIep query is done and returns a valid iep_id before goign to getGoals. There should be some fall back error if this fails.

@canjalal canjalal added this to Compass Dec 23, 2024
@canjalal canjalal converted this from a draft issue Dec 23, 2024
@canjalal canjalal added the bug Something isn't working label Dec 23, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
Status: Todo
Development

No branches or pull requests

1 participant