X-Git-Url: https://git.immae.eu/?a=blobdiff_plain;f=src%2Fcomponents%2Fservices%2FMealie.vue;h=790a9b11f05ec4a5e82f8d96e3c466a634ca41b1;hb=1d3287dcca801a000dbdb40ef20fd26a97ebb2e3;hp=acff1fba97dbde42119cba0617616cf4217e0acd;hpb=b2062fb60ad2845bcba8a517220ca3637e1a885b;p=github%2Fbastienwirtz%2Fhomer.git
diff --git a/src/components/services/Mealie.vue b/src/components/services/Mealie.vue
index acff1fb..790a9b1 100644
--- a/src/components/services/Mealie.vue
+++ b/src/components/services/Mealie.vue
@@ -20,9 +20,7 @@
{{ item.subtitle }}
-
- Today: {{ meal.name }}
-
+ Today: {{ meal.name }}
happily keeping {{ stats.totalRecipes }} recipes organized
@@ -54,37 +52,36 @@ export default {
methods: {
fetchStatus: async function () {
if (this.item.subtitle != null) return; // omitting unnecessary ajax call as the subtitle is showing
- var apikey = this.item.apikey;
this.meal = await fetch(`${this.item.url}/api/meal-plans/today/`, {
headers: {
- "Authorization": "Bearer " + this.item.apikey,
- "Accept": "application/json"
- }
+ Authorization: "Bearer " + this.item.apikey,
+ Accept: "application/json",
+ },
})
- .then(function(response) {
- if (!response.ok) {
- throw new Error("Not 2xx response")
- } else {
- if (response != null) {
- return response.json();
+ .then(function (response) {
+ if (!response.ok) {
+ throw new Error("Not 2xx response");
+ } else {
+ if (response != null) {
+ return response.json();
+ }
}
- }
- })
- .catch((e) => console.log(e));
+ })
+ .catch((e) => console.log(e));
this.stats = await fetch(`${this.item.url}/api/debug/statistics/`, {
headers: {
- "Authorization": "Bearer " + this.item.apikey,
- "Accept": "application/json"
- }
+ Authorization: "Bearer " + this.item.apikey,
+ Accept: "application/json",
+ },
})
- .then(function(response) {
- if (!response.ok) {
- throw new Error("Not 2xx response")
- } else {
- return response.json();
- }
- })
- .catch((e) => console.log(e));
+ .then(function (response) {
+ if (!response.ok) {
+ throw new Error("Not 2xx response");
+ } else {
+ return response.json();
+ }
+ })
+ .catch((e) => console.log(e));
},
},
};