mirror of
https://gitlab.com/spaceti-app/integrations/acs/colnod-connector.git
synced 2026-07-12 14:10:40 +02:00
Merge branch 'finalizing' into 'master'
fix output for deleting subject See merge request spaceti-app/integrations/acs/colnod-connector!35
This commit is contained in:
commit
1a6e136500
@ -22,7 +22,7 @@ int main(int argc, char *argv[])
|
||||
parser.setApplicationDescription("Colnod sync");
|
||||
QCommandLineOption dryModeOption("dryMode", "ColnodAPI", "Read-only mode, prints changes which would normally be made");
|
||||
QCommandLineOption dropTablesOption("dropTables", "ColnodAPI", "Delete tables with datas from Colnod");
|
||||
QCommandLineOption createTablesOption("createTables", "ColnodAPI", "Create tables to saving data from Colnod");
|
||||
QCommandLineOption createTablesOption("createTables", "ColnodAPI", "Create tables for saving data from Colnod");
|
||||
parser.addOption(dryModeOption);
|
||||
parser.addOption(dropTablesOption);
|
||||
parser.addOption(createTablesOption);
|
||||
@ -40,7 +40,6 @@ int main(int argc, char *argv[])
|
||||
QLoggingCategory::setFilterRules(filters.join(QStringLiteral("\n")));
|
||||
|
||||
|
||||
|
||||
SyncManager syncManager(parser.isSet(dryModeOption));
|
||||
|
||||
// Initialize database and colnod API
|
||||
|
||||
@ -81,7 +81,7 @@ bool DatabaseAPI::processData(const std::shared_ptr<Data> &data)
|
||||
qInfo(database) << Message::massageTemplate("Updated", "subject", "database", subject->name());
|
||||
}
|
||||
for (const auto &id : data->deletedSubjects) {
|
||||
qInfo(database) << Message::massageTemplate("Deleted", "token", "database", id);
|
||||
qInfo(database) << Message::massageTemplate("Deleted", "subject", "database", id);
|
||||
}
|
||||
if (!data->updatedTokens.isEmpty() || !data->deletedTokens.isEmpty() ||
|
||||
!data->updatedSubjects.isEmpty() || !data->deletedSubjects.isEmpty()) {
|
||||
@ -292,7 +292,7 @@ int DatabaseAPI::exists(const QString &id, const QString &tableName)
|
||||
qint16 DatabaseAPI::getNumOfTokensOfSubject(const QString &id)
|
||||
{
|
||||
auto query = mDbMan->createQuery();
|
||||
query.prepare("SELECT 1 FROM colnod_token WHERE subject_id = :id AND deleted = false");
|
||||
query.prepare("SELECT 1 FROM colnod_token WHERE subject_id = :id AND description = 'mobile'");
|
||||
query.bindValue(":id", id);
|
||||
if (!executeQuery(query)) {
|
||||
qCritical(database) << "ERROR during accessing existing tokens. EXIT(1)";
|
||||
|
||||
@ -55,7 +55,7 @@ void ColnodTest::download_data_test()
|
||||
QVERIFY(data);
|
||||
|
||||
QVERIFY(! data->updatedTokens.isEmpty());
|
||||
QVERIFY(data->updatedTokens.contains("5e2f1260-da1c-441f-9644-24dfe3b97b2a"));
|
||||
QVERIFY(data->updatedTokens.contains("d3a83bea-2587-4687-946d-ee847eccf477"));
|
||||
}
|
||||
|
||||
void ColnodTest::download_data_test_now()
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user