Untitled

 avatar
unknown
plain_text
a year ago
641 B
5
Indexable
 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();
  }, []);
  
Editor is loading...
Leave a Comment