GillyRabutTsurwa / gilbertrabuttsurwa__site

My main site, build with Nuxt, with the content managed by Storyblok. The site includes a bit of who I am, the projects I have made and access to my other sites. The site will continue to be expanded upon as I get ideas for it.
https://gilbertrabuttsurwa.com
0 stars 0 forks source link

- Use Better Error Handling #15

Closed github-actions[bot] closed 6 months ago

github-actions[bot] commented 6 months ago

consult nuxt documentation, your solution is there

https://github.com/GillyRabutTsurwa/gilbertrabuttsurwa__site/blob/8c5560671e4adb769f20d9f0e77bf4964e1c8503/components/blog/Instaposts.vue#L21


}
onMounted(() => {
  setTimeout(() => {
    //@todo - Use Better Error Handling
    // consult nuxt documentation, your solution is there
    if (instaposts.value?.data) {
      featuredInstaPosts.value = randomArray(instaposts.value.data);
      pending.value = false;
    } else {
      pending.value = false;
      error.value = "Can't Fetch Instagram Posts";
      console.log(error.value);
    }
  }, 3000);
});
</script>

<template>
  <h3>Instagram</h3>
  <Spinner v-if="pending" />
  <h4 v-else-if="error">{{ error }}</h4>
  <div class="picture-category__category">
    <div class="instagram-images">
      <figure v-for="currentInsta in featuredInstaPosts">
        <a :href="currentInsta.permalink" target="_blank" rel="noopener noreferrer">
github-actions[bot] commented 6 months ago

Closed in 1e6edb51e6e4091ebd06834bc2994911a80410fb