* @brief Export a session to CSV (async; check sessions.getStatus / busy). */
| 503 | * @brief Export a session to CSV (async; check sessions.getStatus / busy). |
| 504 | */ |
| 505 | API::CommandResponse API::Handlers::SessionsHandler::exportToCsv(const QString& id, |
| 506 | const QJsonObject& params) |
| 507 | { |
| 508 | if (!params.contains(QStringLiteral("sessionId"))) |
| 509 | return CommandResponse::makeError( |
| 510 | id, ErrorCode::MissingParam, QStringLiteral("Missing required parameter: sessionId")); |
| 511 | |
| 512 | const int sessionId = params.value(QStringLiteral("sessionId")).toInt(); |
| 513 | Sessions::DatabaseManager::instance().exportSessionToCsv(sessionId); |
| 514 | |
| 515 | QJsonObject result; |
| 516 | result[QStringLiteral("sessionId")] = sessionId; |
| 517 | result[QStringLiteral("exporting")] = true; |
| 518 | return CommandResponse::makeSuccess(id, result); |
| 519 | } |
| 520 | |
| 521 | //-------------------------------------------------------------------------------------------------- |
| 522 | // Tags |
nothing calls this directly
no test coverage detected