updated to version 0.1.27

This commit is contained in:
KungKurt 2025-02-23 22:46:55 +01:00
parent 053a2e9ec9
commit f1c5cc51c0
2 changed files with 3 additions and 9 deletions

View File

@ -6,7 +6,7 @@
"authors": [
{ "name": "Robin Riis" }
],
"version": "0.1.26",
"version": "0.1.27",
"socket": true,
"minimumCoreVersion": 10,
"compatibility": {

View File

@ -7,16 +7,10 @@ export class PuckoPruttApi {
}
async _fetch_json(url) {
ret = "Could not fetch "+url
const response = await fetch(this.apiUrl + url).then(
response => response.json()
).then(data => ret = data).catch(
error => console.error("Error: ", error)
);
return ret
return await foundry.utils.fetchJsonWithTimeout(this.apiUrl + url)
}
async dagens_lunch(spider) {
return await this._fetch_json("/spiders/dagens_lunch/" + spider + "/?format=json");
return this._fetch_json("/spiders/dagens_lunch/" + spider + "/?format=json");
}
}