Ahmed Zougari• 270
@zougari47
Posted
Hi there👋,
Did you notice that advice doesn't change while clicking the button, You can fix with this solution
export const GetAdvice = async () => {
const response = await fetch('https://api.adviceslip.com/advice', {
cache: 'no-cache'
})
.then((response) => response.json())
.then((json) => json['slip']);
return {
id: response['id'],
message: response['advice'],
};
};
Nice work & happy coding.
1