diff --git a/module.json b/module.json index ebf865f..527803b 100644 --- a/module.json +++ b/module.json @@ -6,7 +6,7 @@ "authors": [ { "name": "Robin Riis" } ], - "version": "0.1.29", + "version": "0.1.30", "socket": true, "minimumCoreVersion": 10, "compatibility": { diff --git a/scripts/puckoapi/puckoapi.js b/scripts/puckoapi/puckoapi.js index 5115b5a..0bb45f1 100644 --- a/scripts/puckoapi/puckoapi.js +++ b/scripts/puckoapi/puckoapi.js @@ -7,10 +7,14 @@ export class PuckoPruttApi { } async _fetch_json(url) { - return await foundry.utils.fetchJsonWithTimeout(this.apiUrl + url) + const response = await foundry.utils.fetchJsonWithTimeout(this.apiUrl + url); + const dagens = await response.json(); + return dagens; } dagens_lunch(spider) { - return this._fetch_json("/spiders/dagens_lunch/" + spider + "/?format=json"); + this._fetch_json("/spiders/dagens_lunch/" + spider + "/?format=json").then(dagens => { + return dagens; + }); } } \ No newline at end of file