Skip to content

Commit

Permalink
Fix merge issues.
Browse files Browse the repository at this point in the history
  • Loading branch information
getvictor committed May 23, 2024
1 parent b91f345 commit 10dfd37
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 14 deletions.
26 changes: 14 additions & 12 deletions ee/server/service/software_installers.go
Original file line number Diff line number Diff line change
Expand Up @@ -67,12 +67,13 @@ func (svc *Service) UploadSoftwareInstaller(ctx context.Context, payload *fleet.
}

// Create activity
if err := svc.ds.NewActivity(ctx, vc.User, fleet.ActivityTypeAddedSoftware{
SoftwareTitle: payload.Title,
SoftwarePackage: payload.Filename,
TeamName: teamName,
TeamID: payload.TeamID,
}); err != nil {
if err := svc.NewActivity(
ctx, vc.User, fleet.ActivityTypeAddedSoftware{
SoftwareTitle: payload.Title,
SoftwarePackage: payload.Filename,
TeamName: teamName,
TeamID: payload.TeamID,
}); err != nil {
return ctxerr.Wrap(ctx, err, "creating activity for added software")
}

Expand Down Expand Up @@ -111,12 +112,13 @@ func (svc *Service) DeleteSoftwareInstaller(ctx context.Context, titleID uint, t
teamName = &t.Name
}

if err := svc.ds.NewActivity(ctx, vc.User, fleet.ActivityTypeDeletedSoftware{
SoftwareTitle: meta.SoftwareTitle,
SoftwarePackage: meta.Name,
TeamName: teamName,
TeamID: meta.TeamID,
}); err != nil {
if err := svc.NewActivity(
ctx, vc.User, fleet.ActivityTypeDeletedSoftware{
SoftwareTitle: meta.SoftwareTitle,
SoftwarePackage: meta.Name,
TeamName: teamName,
TeamID: meta.TeamID,
}); err != nil {
return ctxerr.Wrap(ctx, err, "creating activity for deleted software")
}

Expand Down
2 changes: 1 addition & 1 deletion server/service/orbit.go
Original file line number Diff line number Diff line change
Expand Up @@ -917,7 +917,7 @@ func (svc *Service) SaveHostSoftwareInstallResult(ctx context.Context, result *f
}
}

if err := svc.ds.NewActivity(
if err := svc.NewActivity(
ctx,
user,
fleet.ActivityTypeInstalledSoftware{
Expand Down
7 changes: 6 additions & 1 deletion server/service/software_installers_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,12 @@ func TestSoftwareInstallersAuth(t *testing.T) {
return nil
}

ds.NewActivityFunc = func(ctx context.Context, user *fleet.User, activity fleet.ActivityDetails) error {
ds.AppConfigFunc = func(ctx context.Context) (*fleet.AppConfig, error) {
return &fleet.AppConfig{}, nil
}
ds.NewActivityFunc = func(
ctx context.Context, user *fleet.User, activity fleet.ActivityDetails, details []byte, createdAt time.Time,
) error {
return nil
}

Expand Down

0 comments on commit 10dfd37

Please sign in to comment.