Untitled

mail@pastecode.io avatar
unknown
plain_text
2 months ago
641 B
2
Indexable
Never
 useEffect(() => {
    // Check if the user is a paid subscriber
    const getEmailAccounts = async () => {
      setIsLoading(true);
      try {
        const response = await axios.get('/api/getEmailAccounts', {
          headers: {
            'user-id': userId,  
          },
        });
        const data = response.data;
        setEmailList(data.users);
        console.log("email accounts data", emailList);
      } catch (error) {
        console.error('Error fetching email accounts:', error);
        // Handle error if needed
      } finally {
        setIsLoading(false);
      }
    };
  
    getEmailAccounts();
  }, []);
  
Leave a Comment