post base 64 with submitUserData function

pull/7/head
Suvodip 2024-05-16 21:22:07 +05:30
parent 04500f43d6
commit 17538eb91c
1 changed files with 17 additions and 16 deletions

View File

@ -472,27 +472,28 @@ import Layout from '../../layouts/Layout.astro';
// 'game_start' : gameStartTime,
};
console.log(userData);
fetch(`https://save-game-data.teachertrainingchennai.in/saveGameData`, {
fetch(`https://save-game-data.teachertrainingchennai.in/saveGameData`, {
method: 'POST',
headers: {
'Content-Type' : 'application/json'
},
body: JSON.stringify(userData)
})
.then(response => {
if(response.ok){
console.log('Data Saved', response)
} else{
// console.log('Something Wrong', response)
}
})
.catch(error => {
console.error('An error occured', error)
});
// Clear the drawing
// graphics.clear();
});
})
.then(response => {
if(response.ok){
console.log('Data Saved', response)
} else{
// console.log('Something Wrong', response)
}
})
.catch(error => {
console.error('An error occured', error)
});
// Clear the drawing
// graphics.clear();
});
};
// function captureSnapshot(drawingZone) {
// submitButton.setVisible(false);