From ccf2b4dd9d41b39167379669f035b45d656e3633 Mon Sep 17 00:00:00 2001 From: Kitsune Ral Date: Fri, 5 Jan 2018 19:46:41 +0900 Subject: 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. --- jobs/generated/inviting.cpp | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) (limited to 'jobs/generated/inviting.cpp') diff --git a/jobs/generated/inviting.cpp b/jobs/generated/inviting.cpp index 6cd67ad7..d2ee2107 100644 --- a/jobs/generated/inviting.cpp +++ b/jobs/generated/inviting.cpp @@ -14,14 +14,10 @@ static const auto basePath = QStringLiteral("/_matrix/client/r0"); InviteUserJob::InviteUserJob(const QString& roomId, const QString& userId) : BaseJob(HttpVerb::Post, "InviteUserJob", - basePath % "/rooms/" % roomId % "/invite", - Query { } - ) + basePath % "/rooms/" % roomId % "/invite") { QJsonObject _data; _data.insert("user_id", toJson(userId)); setRequestData(_data); - - addExpectedContentType("application/json"); } -- cgit v1.2.3