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

Close new brain modal after creation #720

Merged
merged 1 commit into from
Jul 20, 2023
Merged

Close new brain modal after creation #720

merged 1 commit into from
Jul 20, 2023

Conversation

mamadoudicko
Copy link
Contributor

Description

  • Close modal on brain creation

@mamadoudicko mamadoudicko temporarily deployed to preview July 20, 2023 15:56 — with GitHub Actions Inactive
@vercel
Copy link

vercel bot commented Jul 20, 2023

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
docs ✅ Ready (Inspect) Visit Preview 💬 Add feedback Jul 20, 2023 4:23pm
quivrapp ✅ Ready (Inspect) Visit Preview 💬 Add feedback Jul 20, 2023 4:23pm

@github-actions
Copy link
Contributor

github-actions bot commented Jul 20, 2023

LOGAF Level 3: /home/runner/work/quivr/quivr/frontend/lib/components/NavBar/components/NavItems/components/BrainsDropDown/components/AddBrainModal.tsx

The code is generally good, but there are a few areas that could be improved:

  1. Error handling: The error handling could be improved by creating a custom error handler function. This would make the code more readable and maintainable. For example:
const handleError = (err: any) => {
  let message = JSON.stringify(err);
  if (axios.isAxiosError(err) && err.response?.status === 429) {
    message = JSON.stringify((err.response as { data: { detail: string } }).data.detail);
  }
  publish({ variant: "danger", text: message });
};

Then, in your catch block, you can simply call handleError(err).

  1. Form validation: Consider using a form validation library like Formik or react-hook-form. This would make your form validation more robust and easier to manage.

  2. State management: Consider using a reducer for managing the state. This would make your state management more predictable and easier to debug.

  3. Code comments: Consider adding comments to your code to explain what each part of the code does. This would make your code easier to understand for other developers.


🔧💡📝


Powered by Code Review GPT

@gozineb gozineb merged commit 8125d08 into main Jul 20, 2023
4 of 5 checks passed
StanGirard pushed a commit that referenced this pull request Sep 12, 2023
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.

None yet

2 participants