-
-
Notifications
You must be signed in to change notification settings - Fork 3.6k
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
feat: allow user to unsubscribe from a brain #1254
Conversation
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
Risk Level 2 - /home/runner/work/quivr/quivr/backend/models/databases/supabase/brains.py The code changes are generally safe, but there are a few areas that could be improved for better readability and maintainability.
Here are the suggested changes: # Suggested change for delete_brain_user_by_id
self.db.table(\"brains_users\")
.delete()
.match({\"brain_id\": str(brain_id), \"user_id\": str(user_id)})
.execute()
# Suggested change for delete_brain_vector
return self.db.table(\"brains_vectors\")
.delete()
.match({\"brain_id\": brain_id})
.execute() Risk Level 2 - /home/runner/work/quivr/quivr/backend/models/brains.py The code seems to be well written and follows the SOLID principles. However, there are a few areas that could be improved for better readability and maintainability:
Example: def get_unique_brain_files(self):
self.files = self._get_files()
return self.files
def get_all_knowledge_in_brain(self):
self.files = self._get_files()
return self.files
def _get_files(self):
vector_ids = self.supabase_db.get_brain_vector_ids(self.id) # type: ignore
return get_unique_files_from_vector_ids(vector_ids) Risk Level 2 - /home/runner/work/quivr/quivr/frontend/app/brains-management/[brainId]/components/BrainManagementTabs/hooks/useBrainManagementTabs.ts The code is generally well written, but there are a few areas where improvements could be made for readability and maintainability. For example, the 📚🔐🔄 Powered by Code Review GPT |
"deleteConfirmYes": "Oui, supprimer", | ||
"returnButton": "Retour", | ||
"unsubscribeButton": "Se désabonner du cerveau", | ||
"unsubscribeConfirmQuestion": "Êtes-vous sûr de vouloir vous désabonner de ce cerveau ? Cette action ne peut pas être annulée.", |
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.
Ca fait bizarre "cette action ne peut pas etre annulée" vu que tu peux juste repartir t'abonner au cerveau
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.
🚮
0ad24e9
to
b997d38
Compare
delete_brain_user
todelete_brain_users
/POST '/brains/{brain_id}/subscribe'
#1212