(agentID uint)
| 1453 | } |
| 1454 | |
| 1455 | func (a AgentService) loadAgentAndInstall(agentID uint) (*model.Agent, *model.AppInstall, error) { |
| 1456 | agent, err := agentRepo.GetFirst(repo.WithByID(agentID)) |
| 1457 | if err != nil { |
| 1458 | return nil, nil, err |
| 1459 | } |
| 1460 | if agent.AppInstallID == 0 { |
| 1461 | return nil, nil, buserr.New("ErrRecordNotFound") |
| 1462 | } |
| 1463 | install, err := appInstallRepo.GetFirst(repo.WithByID(agent.AppInstallID)) |
| 1464 | if err != nil { |
| 1465 | return nil, nil, err |
| 1466 | } |
| 1467 | return agent, &install, nil |
| 1468 | } |
| 1469 | |
| 1470 | func (a AgentService) loadOpenclawAgentAndInstall(agentID uint) (*model.Agent, *model.AppInstall, error) { |
| 1471 | agent, install, err := a.loadAgentAndInstall(agentID) |
no test coverage detected