(agent *model.Agent)
| 805 | } |
| 806 | |
| 807 | func (a AgentService) deleteCheckByAgent(agent *model.Agent) ([]dto.AppResource, error) { |
| 808 | if agent == nil || agent.WebsiteID == 0 { |
| 809 | return nil, nil |
| 810 | } |
| 811 | website, err := websiteRepo.GetFirst(repo.WithByID(agent.WebsiteID)) |
| 812 | if err != nil { |
| 813 | if err == gorm.ErrRecordNotFound { |
| 814 | return nil, nil |
| 815 | } |
| 816 | return nil, err |
| 817 | } |
| 818 | websiteName, err := loadAgentWebsiteResourceName(website) |
| 819 | if err != nil { |
| 820 | return nil, err |
| 821 | } |
| 822 | return []dto.AppResource{{Type: "website", Name: websiteName}}, nil |
| 823 | } |
| 824 | |
| 825 | func syncAgentAppInstalls(appInstalls []model.AppInstall) { |
| 826 | if len(appInstalls) == 0 { |
no test coverage detected