mirror of
https://github.com/QuivrHQ/quivr.git
synced 2024-12-14 17:03:29 +03:00
fix(frontend & backend): unsubscribe from brain (#2373)
# Description Please include a summary of the changes and the related issue. Please also include relevant motivation and context. ## Checklist before requesting a review Please delete options that are not relevant. - [ ] My code follows the style guidelines of this project - [ ] I have performed a self-review of my code - [ ] I have commented hard-to-understand areas - [ ] I have ideally added tests that prove my fix is effective or that my feature works - [ ] New and existing unit tests pass locally with my changes - [ ] Any dependent changes have been merged ## Screenshots (if appropriate):
This commit is contained in:
parent
ca6e4455a6
commit
1381a0729e
@ -458,11 +458,7 @@ async def unsubscribe_from_brain_handler(
|
||||
|
||||
if brain is None:
|
||||
raise HTTPException(status_code=404, detail="Brain not found")
|
||||
if brain.status != "public":
|
||||
raise HTTPException(
|
||||
status_code=403,
|
||||
detail="You cannot subscribe to this brain without invitation",
|
||||
)
|
||||
|
||||
# check if user is already subscribed to brain
|
||||
user_brain = brain_user_service.get_brain_for_user(current_user.id, brain_id)
|
||||
if user_brain is None:
|
||||
|
@ -42,7 +42,7 @@ const BrainsManagement = (): JSX.Element => {
|
||||
hidden: !isOwnedByCurrentUser || !brain?.max_files,
|
||||
},
|
||||
{
|
||||
label: "Delete brain",
|
||||
label: isOwnedByCurrentUser ? "Delete Brain" : "Unsubscribe from Brain",
|
||||
color: "dangerous",
|
||||
onClick: () => {
|
||||
setIsDeleteOrUnsubscribeModalOpened(true);
|
||||
|
Loading…
Reference in New Issue
Block a user