mirror of
https://github.com/StanGirard/quivr.git
synced 2024-09-11 13:15:41 +03:00
fix: 🐛 subscription (#2081)
error in role assignment # 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
31ce6c0566
commit
eded4d9bdd
@ -4,7 +4,6 @@ import { MdOutlineRemoveCircle } from "react-icons/md";
|
||||
|
||||
import Field from "@/lib/components/ui/Field";
|
||||
import { Select } from "@/lib/components/ui/Select";
|
||||
import { useBrainContext } from "@/lib/context/BrainProvider/hooks/useBrainContext";
|
||||
|
||||
import { BrainRoleAssignation, BrainRoleType } from "./BrainUsers/types";
|
||||
import { userRoleToAssignableRoles } from "./ShareBrain/types";
|
||||
@ -25,7 +24,6 @@ export const UserToInvite = ({
|
||||
roleAssignation.role
|
||||
);
|
||||
const [email, setEmail] = useState(roleAssignation.email);
|
||||
const { currentBrain } = useBrainContext();
|
||||
|
||||
useEffect(() => {
|
||||
onChange({
|
||||
@ -33,13 +31,9 @@ export const UserToInvite = ({
|
||||
email,
|
||||
role: selectedRole,
|
||||
});
|
||||
}, [email, selectedRole]);
|
||||
}, [email, onChange, roleAssignation, selectedRole]);
|
||||
|
||||
if (currentBrain === undefined) {
|
||||
return <div />;
|
||||
}
|
||||
|
||||
const assignableRoles = userRoleToAssignableRoles[currentBrain.role];
|
||||
const assignableRoles = userRoleToAssignableRoles["Owner"];
|
||||
const translatedOptions = assignableRoles.map((role) => ({
|
||||
value: role.value,
|
||||
// eslint-disable-next-line @typescript-eslint/no-unsafe-assignment
|
||||
|
Loading…
Reference in New Issue
Block a user