@@ -2,9 +2,10 @@ import { Show, createEffect, createMemo, useContext } from "solid-js";
22import { createSignal } from "solid-js" ;
33import { Dialog , DialogOverlay , DialogPanel , DialogTitle } from "terracotta" ;
44import { UserContext } from "../contexts/UserContext" ;
5- import { DefaultError , SlimUser , fromI32ToUserRole } from "shared/types" ;
5+ import { DefaultError , fromI32ToUserRole } from "shared/types" ;
66import { UserRole , fromUserRoleToI32 , stringToUserRole } from "shared/types" ;
77import { createToast } from "./ShowToasts" ;
8+ import { SlimUser } from "trieve-ts-sdk" ;
89
910export interface InviteUserModalProps {
1011 editingUser : SlimUser | null ;
@@ -23,13 +24,13 @@ export const EditUserModal = (props: InviteUserModalProps) => {
2324
2425 const currentUserRole = createMemo ( ( ) => {
2526 return userContext . user ?.( ) ?. user_orgs . find ( ( val ) => {
26- return val . organization_id === userContext . selectedOrganizationId ?. ( ) ;
27+ return val . organization_id === userContext . selectedOrg ( ) . id ;
2728 } ) ?. role ;
2829 } ) ;
2930
3031 const editingUserRole = createMemo ( ( ) => {
3132 return props . editingUser ?. user_orgs . find ( ( val ) => {
32- return val . organization_id === userContext . selectedOrganizationId ?. ( ) ;
33+ return val . organization_id === userContext . selectedOrg ( ) . id ;
3334 } ) ?. role ;
3435 } ) ;
3536
@@ -41,7 +42,7 @@ export const EditUserModal = (props: InviteUserModalProps) => {
4142 "Content-Type" : "application/json" ,
4243 } ,
4344 body : JSON . stringify ( {
44- organization_id : userContext . selectedOrganizationId ?. ( ) ,
45+ organization_id : userContext . selectedOrg ( ) . id ,
4546 user_id : props . editingUser ?. id ,
4647 role : fromUserRoleToI32 ( role ( ) ) ,
4748 } ) ,
0 commit comments