diff --git a/native/MainPage.qml b/native/MainPage.qml index 2cb18eb..8f2c294 100644 --- a/native/MainPage.qml +++ b/native/MainPage.qml @@ -149,7 +149,7 @@ Rectangle { text: qsTr("Delete") Layout.preferredWidth: 100 onClicked: { - deleteLicense(model.key) + deleteLicense(model.id) } } } @@ -205,7 +205,8 @@ Rectangle { start: jsonResponse[i].licenses[ii].start ?? "Indefinitely", end: jsonResponse[i].licenses[ii].end ?? "Indefinitely", 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(); - 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.onreadystatechange = function() { if (xhr.readyState === XMLHttpRequest.DONE) {