This error is in the console and it prevents the app from working, I cant find the bug at all if anyone could help? Its a MERN application
The code in question
export const getPosts = () => async (dispatch) => {
try {
const { data } = await api.fetchPosts();
dispatch({ type: 'FETCH_ALL', payload: data });
} catch (error) {
console.log(error.message);
}
};
VSC is telling me await doesn't effect this kind of expression, which it should as fetchPosts is a request? The code for this is below
export const fetchPosts = () => {
axios.get(url)
}