* @brief Returns the templates manifest. */
| 5586 | * @brief Returns the templates manifest. |
| 5587 | */ |
| 5588 | API::CommandResponse API::Handlers::ProjectHandler::templateList(const QString& id, |
| 5589 | const QJsonObject& params) |
| 5590 | { |
| 5591 | Q_UNUSED(params) |
| 5592 | |
| 5593 | const auto manifest = loadTemplateManifest(); |
| 5594 | if (manifest.isNull()) |
| 5595 | return CommandResponse::makeError( |
| 5596 | id, ErrorCode::ExecutionError, QStringLiteral("Failed to load templates manifest")); |
| 5597 | |
| 5598 | QJsonObject result; |
| 5599 | result[QStringLiteral("templates")] = manifest.object().value(QStringLiteral("templates")); |
| 5600 | return CommandResponse::makeSuccess(id, result); |
| 5601 | } |
| 5602 | |
| 5603 | /** |
| 5604 | * @brief Loads a template into the project model. |
nothing calls this directly
no test coverage detected