* @brief Applies a painter script, resolving the target group from the request. */
| 1300 | * @brief Applies a painter script, resolving the target group from the request. |
| 1301 | */ |
| 1302 | static QJsonObject applyPainterScript(const QJsonObject& args, const QJsonObject& dryRun) |
| 1303 | { |
| 1304 | auto groupReply = resolveGroup(args); |
| 1305 | if (!groupReply.value(QStringLiteral("ok")).toBool()) |
| 1306 | return groupReply; |
| 1307 | |
| 1308 | QJsonObject applyArgs; |
| 1309 | applyArgs[QStringLiteral("code")] = args.value(QStringLiteral("code")).toString(); |
| 1310 | applyArgs[QStringLiteral("groupId")] = |
| 1311 | groupReply.value(QStringLiteral("group")).toObject().value(QStringLiteral("groupId")).toInt(); |
| 1312 | |
| 1313 | const QString command = QStringLiteral("project.painter.setCode"); |
| 1314 | auto applyReply = runCommand(command, applyArgs); |
| 1315 | applyReply[QStringLiteral("dryRun")] = dryRun; |
| 1316 | return attachRepairHint(applyReply, command); |
| 1317 | } |
| 1318 | |
| 1319 | /** |
| 1320 | * @brief Validates a script with dryRun, then routes the apply to the right project mutation. |
no test coverage detected