native: fix key
This commit is contained in:
parent
8d2cf83d33
commit
0619572c05
1 changed files with 5 additions and 4 deletions
|
@ -149,7 +149,7 @@ Rectangle {
|
||||||
text: qsTr("Delete")
|
text: qsTr("Delete")
|
||||||
Layout.preferredWidth: 100
|
Layout.preferredWidth: 100
|
||||||
onClicked: {
|
onClicked: {
|
||||||
deleteLicense(model.key)
|
deleteLicense(model.id)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -205,7 +205,8 @@ Rectangle {
|
||||||
start: jsonResponse[i].licenses[ii].start ?? "Indefinitely",
|
start: jsonResponse[i].licenses[ii].start ?? "Indefinitely",
|
||||||
end: jsonResponse[i].licenses[ii].end ?? "Indefinitely",
|
end: jsonResponse[i].licenses[ii].end ?? "Indefinitely",
|
||||||
amount: jsonResponse[i].licenses[ii].amount ? jsonResponse[i].licenses[ii].amount.toString() : "∞",
|
amount: jsonResponse[i].licenses[ii].amount ? jsonResponse[i].licenses[ii].amount.toString() : "∞",
|
||||||
key: jsonResponse[i].licenses[ii].id
|
key: jsonResponse[i].licenses[ii].key,
|
||||||
|
id: jsonResponse[i].licenses[ii].id
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -240,9 +241,9 @@ Rectangle {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
function deleteLicense(key) {
|
function deleteLicense(id) {
|
||||||
var xhr = new XMLHttpRequest();
|
var xhr = new XMLHttpRequest();
|
||||||
xhr.open("DELETE", "https://api.clan-war.net/api/v1/licenses/" + key);
|
xhr.open("DELETE", "https://api.clan-war.net/api/v1/licenses/" + id);
|
||||||
xhr.setRequestHeader("Authorization", "Bearer " + authToken);
|
xhr.setRequestHeader("Authorization", "Bearer " + authToken);
|
||||||
xhr.onreadystatechange = function() {
|
xhr.onreadystatechange = function() {
|
||||||
if (xhr.readyState === XMLHttpRequest.DONE) {
|
if (xhr.readyState === XMLHttpRequest.DONE) {
|
||||||
|
|
Loading…
Reference in a new issue