File tree Expand file tree Collapse file tree 2 files changed +9
-7
lines changed
src/custom/DashboardWidgets/GettingStartedWidget Expand file tree Collapse file tree 2 files changed +9
-7
lines changed Original file line number Diff line number Diff line change @@ -75,7 +75,7 @@ interface GetStartedModalProps {
7575 useLazyGetTeamsQuery : any ;
7676 embedDesignPath : string ;
7777 isFromMeshery : boolean ;
78- useGetUserByEmailQuery : any ;
78+ useGetUserByEmailQuery ? : any ;
7979}
8080
8181const Loading : React . FC < LoadingProps > = ( { showModal, handleClose, style } ) => {
Original file line number Diff line number Diff line change @@ -68,7 +68,7 @@ interface UserInviteModalProps {
6868 } ;
6969 isAssignUserRolesAllowed : boolean ;
7070 useLazyGetTeamsQuery : any ;
71- useGetUserByEmailQuery : any ;
71+ useGetUserByEmailQuery ? : any ;
7272}
7373
7474export default function UserInviteModal ( {
@@ -104,11 +104,13 @@ export default function UserInviteModal({
104104 const defaultOrgSelection = { id : 'none' , name : 'None' } ;
105105 const [ organization , setOrganization ] = useState < Organization > ( defaultOrgSelection ) ;
106106
107- // Query to check if user exists by email
108- const { data : existingUserData } = useGetUserByEmailQuery (
109- { email : inviteeEmail } ,
110- { skip : ! inviteeEmail || ! EMAIL_REGEXP . test ( inviteeEmail ) }
111- ) ;
107+ // Query to check if user exists by email (only if hook is provided)
108+ const { data : existingUserData } = useGetUserByEmailQuery
109+ ? useGetUserByEmailQuery (
110+ { email : inviteeEmail } ,
111+ { skip : ! inviteeEmail || ! EMAIL_REGEXP . test ( inviteeEmail ) }
112+ )
113+ : { data : null } ;
112114
113115 const { data : providerRolesData } = useGetUserOrgRolesQuery ( {
114116 orgId : currentOrgId ,
You can’t perform that action at this time.
0 commit comments