post base 64 with submitUserData function
parent
04500f43d6
commit
17538eb91c
|
@ -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)
|
||||
});
|
||||
})
|
||||
.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();
|
||||
});
|
||||
// Clear the drawing
|
||||
// graphics.clear();
|
||||
});
|
||||
};
|
||||
// function captureSnapshot(drawingZone) {
|
||||
// submitButton.setVisible(false);
|
||||
|
|
Loading…
Reference in New Issue