Untitled
unknown
plain_text
2 years ago
641 B
6
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