Auto Fetch First Game Index
This commit is contained in:
parent
e56c051267
commit
a09f654c93
1 changed files with 15 additions and 5 deletions
|
@ -3,18 +3,28 @@
|
|||
import { LeanChellarisDataStore } from '$lib/stores/ChellarisData';
|
||||
import Header from './Header.svelte';
|
||||
import './styles.css';
|
||||
import AdminSelectedGameStore from '$lib/stores/admin-page/GameStore';
|
||||
|
||||
$: {
|
||||
fetch(apiBaseUrl + '/v3/ethics').then((res) => {
|
||||
res.json().then((data) => {
|
||||
$LeanChellarisDataStore.ethics = data.ethics;
|
||||
})
|
||||
});
|
||||
});
|
||||
|
||||
fetch(apiBaseUrl + '/v3/phenotypes').then((res) => {
|
||||
res.json().then((data) => {
|
||||
$LeanChellarisDataStore.phenotypes = data.phenotypes;
|
||||
})
|
||||
});
|
||||
});
|
||||
|
||||
fetch(apiBaseUrl + '/v3/games').then((res) => {
|
||||
res.json().then((data) => {
|
||||
if ($AdminSelectedGameStore == 1) {
|
||||
$AdminSelectedGameStore = data[0].id;
|
||||
}
|
||||
|
||||
});
|
||||
});
|
||||
}
|
||||
</script>
|
||||
|
|
Reference in a new issue