From 0619572c0578c33f231112a78147f70fd1ba3b1e Mon Sep 17 00:00:00 2001 From: jopejoe1 Date: Fri, 12 Jul 2024 11:04:10 +0200 Subject: [PATCH] native: fix key --- native/MainPage.qml | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) 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) {