categorized emtotepopup
This commit is contained in:
@@ -20,25 +20,25 @@ void TwitchApi::findUserId(const QString user,
|
||||
request.onSuccess([successCallback](auto result) mutable -> Outcome {
|
||||
auto root = result.parseJson();
|
||||
if (!root.value("users").isArray()) {
|
||||
Log("API Error while getting user id, users is not an array");
|
||||
log("API Error while getting user id, users is not an array");
|
||||
successCallback("");
|
||||
return Failure;
|
||||
}
|
||||
auto users = root.value("users").toArray();
|
||||
if (users.size() != 1) {
|
||||
Log("API Error while getting user id, users array size is not 1");
|
||||
log("API Error while getting user id, users array size is not 1");
|
||||
successCallback("");
|
||||
return Failure;
|
||||
}
|
||||
if (!users[0].isObject()) {
|
||||
Log("API Error while getting user id, first user is not an object");
|
||||
log("API Error while getting user id, first user is not an object");
|
||||
successCallback("");
|
||||
return Failure;
|
||||
}
|
||||
auto firstUser = users[0].toObject();
|
||||
auto id = firstUser.value("_id");
|
||||
if (!id.isString()) {
|
||||
Log("API Error: while getting user id, first user object `_id` key "
|
||||
log("API Error: while getting user id, first user object `_id` key "
|
||||
"is not a "
|
||||
"string");
|
||||
successCallback("");
|
||||
|
||||
Reference in New Issue
Block a user