giphy api changed heavily

This commit is contained in:
Thomas Ruoff
2021-11-24 23:29:32 +01:00
parent dc53021d84
commit 49f2bb62b5

View File

@@ -5,11 +5,11 @@ const Header = () => {
useEffect(() => { useEffect(() => {
async function getGif() { async function getGif() {
const response = await fetch( const response = await fetch(
"//api.giphy.com/v1/gifs/random?tag=christmas&api_key=3ziHSa4ptYJdv2dOuawgzpBhhiW09Ss1" "https://api.giphy.com/v1/gifs/random?tag=christmas&api_key=3ziHSa4ptYJdv2dOuawgzpBhhiW09Ss1"
); );
const { data } = await response.json(); const { data } = await response.json();
console.log(data) const gifUrl = data?.images?.fixed_height_small?.webp;
setGifUrl(data.image_webp_url); setGifUrl(gifUrl);
} }
getGif(); getGif();