Temporary fix to ldb page to allow test build
This commit is contained in:
@@ -10,17 +10,13 @@
|
||||
return new URLSearchParams(window.location.search).get('station');
|
||||
}
|
||||
|
||||
/**
|
||||
* @type {any[]}
|
||||
*/
|
||||
let jsonData = [] // Extract train data from the object to pass to #each
|
||||
|
||||
onMount(async () => {
|
||||
const station = await getHeadcode();
|
||||
document.getElementById('station').textContent = station;
|
||||
const data = await fetch(`https://owlboard.info/api/v1/ldb/${station}`);
|
||||
const jsonData = await data.json()['GetStationBoardResult'];
|
||||
//document.getElementById('data_raw').textContent = JSON.stringify(await data.json());
|
||||
jsonData = await data.json();
|
||||
})
|
||||
|
||||
</script>
|
||||
@@ -28,9 +24,8 @@
|
||||
<Header {title} />
|
||||
|
||||
<p>Station: <span id="station"></span></p>
|
||||
{#each jsonData.trainServices.service as item}
|
||||
<p>{item.operator}</p>
|
||||
{/each}
|
||||
|
||||
<p>{JSON.stringify(jsonData)}</p>
|
||||
|
||||
|
||||
<Nav />
|
||||
Reference in New Issue
Block a user