Add Achievements view
parent
4c76e8dba0
commit
0376a34118
@ -0,0 +1,49 @@
|
||||
<x-layout>
|
||||
<x-slot name="scripts">
|
||||
<script src="https://cdn.jsdelivr.net/npm/axios/dist/axios.min.js"></script>
|
||||
|
||||
<script>
|
||||
window.addEventListener('DOMContentLoaded', () => {
|
||||
document.getElementById('fetchAchievements').addEventListener('click', function() {
|
||||
var username = document.getElementById('username').value;
|
||||
var gameId = document.getElementById('game_id').value;
|
||||
|
||||
axios.post('/achievements', { username, game_id: gameId })
|
||||
.then(function(response) {
|
||||
var achievementsResult = document.getElementById('achievementsResult');
|
||||
achievementsResult.innerText = JSON.stringify(response.data, null, 2);
|
||||
})
|
||||
.catch(function(error) {
|
||||
console.error(error);
|
||||
});
|
||||
});
|
||||
|
||||
});
|
||||
|
||||
</script>
|
||||
</x-slot>
|
||||
<x-slot name="title">Achievement Test</x-slot>
|
||||
|
||||
<x-slot name="content">
|
||||
|
||||
<div class="container px-4 mx-auto mt-20 ml-20">
|
||||
<div class="flex flex-col my-10 lg:flex-row">
|
||||
<form id="achievementsForm">
|
||||
<div>
|
||||
<label for="username">Username:</label>
|
||||
<input type="text" id="username" name="username">
|
||||
</div>
|
||||
<div>
|
||||
<label for="game_id">Game ID:</label>
|
||||
<input type="text" id="game_id" name="game_id">
|
||||
</div>
|
||||
<div>
|
||||
<button type="button" id="fetchAchievements">Fetch Achievements</button>
|
||||
</div>
|
||||
</form>
|
||||
<div id="achievementsResult"></div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</x-slot>
|
||||
</x-layout>
|
Loading…
Reference in New Issue