2022-06-01 22:23:12 +02:00
|
|
|
document.getElementById("tournamentSubmit").addEventListener("click", function () {
|
|
|
|
var xhttp = new XMLHttpRequest();
|
|
|
|
xhttp.onreadystatechange = function () {
|
|
|
|
if (this.readyState == 4 && this.status == 200) {
|
|
|
|
alert("Dodano turniej");
|
|
|
|
} else if (this.readyState == 4) {
|
|
|
|
alert("something not work :( " + this.status);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
xhttp.open("PUT", "dragonmaster.pl/inz/tournament");
|
|
|
|
xhttp.setRequestHeader("Authorization", "Bearer " + token);
|
2022-06-02 17:53:56 +02:00
|
|
|
xhttp.send('{"name":"' + document.getElementById("tournamentName").value +
|
|
|
|
'","typeOfLadder":"' + document.getElementById("ladderType").value +
|
|
|
|
'","pointsForTournament":"' + document.getElementById("tournamentPoints").value +
|
|
|
|
'","places":"' + document.getElementById("tournamentPlace").value +
|
|
|
|
'","roles":"' + document.getElementById("tournamentRole").value +
|
|
|
|
'","ranked":"' + document.getElementById("isRanked").value +
|
|
|
|
'","place":"' + document.getElementById("tournamentPlace").value +
|
|
|
|
'","from":"' + document.getElementById("tournamentFrom").value +
|
|
|
|
'","to":"' + document.getElementById("tournamentTo").value +
|
|
|
|
'","rang":"' + document.getElementById("tournamentRang").value +
|
|
|
|
'","entyFee":"' + document.getElementById("tournamentEntyFee").value +
|
|
|
|
'","director":"' + document.getElementById("tournamentDirector").value +
|
|
|
|
'","phone":"' + document.getElementById("directorphone").value +
|
|
|
|
'","entriesTo":"' + document.getElementById("tournamentEntriesTo").value +
|
|
|
|
'","additionalInformations":"' + document.getElementById("tournamentAddInfo").value +
|
|
|
|
'","category":"' + "cat1" +
|
|
|
|
'","}');
|
2022-06-01 22:23:12 +02:00
|
|
|
});
|