aboutsummaryrefslogtreecommitdiff
path: root/jobs/generated/login.cpp
diff options
context:
space:
mode:
authorKitsune Ral <Kitsune-Ral@users.sf.net>2018-01-05 19:46:41 +0900
committerKitsune Ral <Kitsune-Ral@users.sf.net>2018-01-05 19:57:52 +0900
commitccf2b4dd9d41b39167379669f035b45d656e3633 (patch)
treea6afb913b58409335809f8ea6a33dd7a16c3f2ca /jobs/generated/login.cpp
parentea5cd86a9deacc9a6b57f1c432ad6e51e92de428 (diff)
downloadlibquotient-ccf2b4dd9d41b39167379669f035b45d656e3633.tar.gz
libquotient-ccf2b4dd9d41b39167379669f035b45d656e3633.zip
jobs: expect application/json by default; set query in constructor body; properly convert numbers to strings in query
The query should be set in constructor body because there's no reason to pass non-required parameters into the query. As for numbers to strings conversion - there was an attempt to use QJsonValue(a).toString() for that. That doesn't work; QJsonValue does not turn numbers to strings.
Diffstat (limited to 'jobs/generated/login.cpp')
-rw-r--r--jobs/generated/login.cpp7
1 files changed, 2 insertions, 5 deletions
diff --git a/jobs/generated/login.cpp b/jobs/generated/login.cpp
index 67d991db..a4dab428 100644
--- a/jobs/generated/login.cpp
+++ b/jobs/generated/login.cpp
@@ -23,9 +23,8 @@ class LoginJob::Private
LoginJob::LoginJob(const QString& type, const QString& user, const QString& medium, const QString& address, const QString& password, const QString& token, const QString& deviceId, const QString& initialDeviceDisplayName)
: BaseJob(HttpVerb::Post, "LoginJob",
- basePath % "/login",
- Query { }, Data { }, false
- ), d(new Private)
+ basePath % "/login", false)
+ , d(new Private)
{
QJsonObject _data;
_data.insert("type", toJson(type));
@@ -44,8 +43,6 @@ LoginJob::LoginJob(const QString& type, const QString& user, const QString& medi
if (!initialDeviceDisplayName.isEmpty())
_data.insert("initial_device_display_name", toJson(initialDeviceDisplayName));
setRequestData(_data);
-
- addExpectedContentType("application/json");
}
LoginJob::~LoginJob() = default;