fix response parsing of edit and create RunePage
This commit is contained in:
parent
c2d198b1c7
commit
2b92291fa4
|
@ -254,7 +254,7 @@ bool ClientAPI::editRunePage(const RunePage& page) {
|
|||
qInfo().noquote() << "requeststr: " << requestdocstr;
|
||||
QJsonDocument doc = request("lol-perks/v1/pages/" + QString::number(page.id), Method::PUT, requestdocstr);
|
||||
|
||||
if(doc.isEmpty()) return true; // ok
|
||||
if(doc.isObject() && doc["isValid"].isBool() && doc["isValid"].toBool()) return true; // ok
|
||||
|
||||
// error
|
||||
qWarning() << "error editing runepage: " << page.id << " " << doc.toJson();
|
||||
|
@ -281,7 +281,7 @@ bool ClientAPI::createRunePage(const RunePage& page) {
|
|||
qInfo() << "requeststr: " << requestdocstr;
|
||||
QJsonDocument doc = request("lol-perks/v1/pages/", Method::POST, requestdocstr);
|
||||
|
||||
if(doc.isEmpty()) return true; // ok
|
||||
if(doc.isObject() && doc["isValid"].isBool() && doc["isValid"].toBool()) return true; // ok
|
||||
|
||||
// error
|
||||
qWarning() << "error creating runepage: " << page.name << " " << doc.toJson();
|
||||
|
|
Loading…
Reference in New Issue