Skip to content
Snippets Groups Projects

Issue#2 solved

2 files
+ 28
0
Compare changes
  • Side-by-side
  • Inline
Files
2
@@ -60,4 +60,20 @@ function createPokemonTypesTable() {
</tbody>
</table>
`
}
function createTrainer() {
const name = document.getElementById('trainerName').value;
const profileurl = document.getElementById('profileUrl').value;
const data = {
profileUrl: profileurl,
name: name
}
fetch('/pokemon/api/trainers', {
method: 'POST',
headers: {
'Content-Type': 'application/json'
},
body: JSON.stringify(data)
}).then(response => updateTrainerTable())
}
\ No newline at end of file
Loading