mirror of
https://gitlab.com/spaceti-app/integrations/common/server-sdk.git
synced 2026-07-12 12:50:50 +02:00
Fix quotes
This commit is contained in:
parent
8aa786fa51
commit
403c2e4a2d
@ -35,7 +35,6 @@ QByteArray DatabaseTable::jsonData(const QSet<QString> &filters) const
|
||||
bool DatabaseTable::fromJson(const QByteArray &data)
|
||||
{
|
||||
// in: JSON ( e.g. {"id": 300} )
|
||||
qDebug(sdkdb) << "Response:" << data;
|
||||
QJsonDocument doc = QJsonDocument::fromJson(data);
|
||||
QVariantMap variant = qvariant_cast<QVariantMap>(doc.toVariant());
|
||||
|
||||
|
||||
@ -139,6 +139,8 @@ QSqlQuery DatabaseUtils::insertIntoTable(const DatabaseTable *table, const QStri
|
||||
values += ":" + key;
|
||||
}
|
||||
|
||||
|
||||
|
||||
QSqlQuery query(mDatabaseManager->database());
|
||||
QString queryText = QString("INSERT INTO %1 ( %2 ) VALUES ( %3 );").arg(table_name).arg(columns).arg(values);
|
||||
query.prepare(queryText);
|
||||
@ -146,7 +148,15 @@ QSqlQuery DatabaseUtils::insertIntoTable(const DatabaseTable *table, const QStri
|
||||
for (const auto& _key : keys ) {
|
||||
QString key = fromCamelCase(_key);
|
||||
auto value = valueMap.value(_key);
|
||||
query.bindValue(":"+key, value);
|
||||
if (value.type() == QVariant::Type::String) {
|
||||
QString temp = "'" + value.toString() + "'";
|
||||
query.bindValue(":" + key, temp);
|
||||
} else if (value.type() == QVariant::Type::DateTime) {
|
||||
QString temp = "'" + value.toDateTime().toString("yyyy-MM-dd hh:mm:ss") + "'";
|
||||
query.bindValue(":" + key, temp);
|
||||
} else {
|
||||
query.bindValue(":" + key, value);
|
||||
}
|
||||
}
|
||||
|
||||
QSqlQuery res = mDatabaseManager->executeQuery(query);
|
||||
@ -184,7 +194,15 @@ QSqlQuery DatabaseUtils::updateTable(const DatabaseTable *table, const QString &
|
||||
for (const auto& _key : keys ) {
|
||||
QString key = fromCamelCase(_key);
|
||||
auto value = valueMap.value(_key);
|
||||
query.bindValue(":"+key, value);
|
||||
if (value.type() == QVariant::Type::String) {
|
||||
QString temp = "'" + value.toString() + "'";
|
||||
query.bindValue(":" + key, temp);
|
||||
} else if (value.type() == QVariant::Type::DateTime) {
|
||||
QString temp = "'" + value.toDateTime().toString("yyyy-MM-dd hh:mm:ss") + "'";
|
||||
query.bindValue(":" + key, temp);
|
||||
} else {
|
||||
query.bindValue(":" + key, value);
|
||||
}
|
||||
}
|
||||
|
||||
QSqlQuery res = mDatabaseManager->executeQuery(query);
|
||||
|
||||
@ -59,9 +59,9 @@ bool RequestManager::processRequest(const std::shared_ptr<Request>& request)
|
||||
}
|
||||
|
||||
|
||||
foreach (auto header, reply->request().rawHeaderList()) {
|
||||
qDebug(sdknetwork) << header << ":" << reply->request().rawHeader(header);
|
||||
}
|
||||
// foreach (auto header, reply->request().rawHeaderList()) {
|
||||
// qDebug(sdknetwork) << header << ":" << reply->request().rawHeader(header);
|
||||
// }
|
||||
|
||||
Q_ASSERT(reply);
|
||||
// Adding reply to final request
|
||||
@ -125,8 +125,6 @@ void RequestManager::downloadProgress(qint64 bytesReceived, qint64 bytesTotal)
|
||||
}
|
||||
QByteArray data = reply->readAll();
|
||||
|
||||
qDebug(sdknetwork) << data;
|
||||
|
||||
// Decompress gzip data
|
||||
#ifdef CORESDK_ZLIB
|
||||
if (encoding.toLower() == "gzip" && !data.isEmpty() ) {
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user