The communications platform that puts data protection first.
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 
Rocket.Chat/apps/meteor/client/views/hooks/useMemberExists.ts

13 lines
448 B

import { useEndpoint } from '@rocket.chat/ui-contexts';
import { useQuery } from '@tanstack/react-query';
type UseMemberExistsProps = { roomId: string; username: string };
export const useMemberExists = ({ roomId, username }: UseMemberExistsProps) => {
const checkMember = useEndpoint('GET', '/v1/rooms.isMember');
return useQuery({
queryKey: ['rooms/isMember', roomId, username],
queryFn: () => checkMember({ roomId, username }),
});
};