updated to version 0.1.27
This commit is contained in:
parent
053a2e9ec9
commit
f1c5cc51c0
@ -6,7 +6,7 @@
|
|||||||
"authors": [
|
"authors": [
|
||||||
{ "name": "Robin Riis" }
|
{ "name": "Robin Riis" }
|
||||||
],
|
],
|
||||||
"version": "0.1.26",
|
"version": "0.1.27",
|
||||||
"socket": true,
|
"socket": true,
|
||||||
"minimumCoreVersion": 10,
|
"minimumCoreVersion": 10,
|
||||||
"compatibility": {
|
"compatibility": {
|
||||||
|
|||||||
@ -7,16 +7,10 @@ export class PuckoPruttApi {
|
|||||||
}
|
}
|
||||||
|
|
||||||
async _fetch_json(url) {
|
async _fetch_json(url) {
|
||||||
ret = "Could not fetch "+url
|
return await foundry.utils.fetchJsonWithTimeout(this.apiUrl + url)
|
||||||
const response = await fetch(this.apiUrl + url).then(
|
|
||||||
response => response.json()
|
|
||||||
).then(data => ret = data).catch(
|
|
||||||
error => console.error("Error: ", error)
|
|
||||||
);
|
|
||||||
return ret
|
|
||||||
}
|
}
|
||||||
|
|
||||||
async dagens_lunch(spider) {
|
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");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
Loading…
x
Reference in New Issue
Block a user