diff --git a/src/components/NestLoader.vue b/src/components/NestLoader.vue
new file mode 100644
index 0000000..db8f133
--- /dev/null
+++ b/src/components/NestLoader.vue
@@ -0,0 +1,84 @@
+
+
+
+
+
+
+
diff --git a/src/views/celestials/Celestial.vue b/src/views/celestials/Celestial.vue
index c3d5cbc..a8e7930 100644
--- a/src/views/celestials/Celestial.vue
+++ b/src/views/celestials/Celestial.vue
@@ -3,6 +3,10 @@
+
+
Une erreur est survenue : {{ error }}
+
{{ celestial }}
+
@@ -18,7 +22,7 @@ export default defineComponent({
name: "Celestial",
data() {
return {
- celestial: {},
+ celestial: Object,
error: ""
};
},
@@ -28,6 +32,7 @@ export default defineComponent({
required: true
}
},
+
mounted() {
// Fetches from API...
this.fetchCelestial()
@@ -35,23 +40,20 @@ export default defineComponent({
// ...and add type
this.celestial = addCelestialType(res);
})
- .catch(err => {
- this.error = err.message;
+ .catch(() => {
+ this.error = "Impossible de récupérer l'astre demandé.";
});
},
+
methods: {
/**
- * Fetches celestial bodies from API
+ * Fetches celestial body from API
*/
fetchCelestial(): Promise