Skip to content

Commit

Permalink
Addressed feedback from Review
Browse files Browse the repository at this point in the history
  • Loading branch information
benjaminguttmann-avtq committed Nov 12, 2024
1 parent 8f175cf commit f57142e
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 12 deletions.
5 changes: 1 addition & 4 deletions api/handlers/app.go
Original file line number Diff line number Diff line change
Expand Up @@ -223,15 +223,12 @@ func (h *App) listDroplets(r *http.Request) (*routing.Response, error) {
logger := logr.FromContextOrDiscard(r.Context()).WithName("handlers.app.get-droplets")
appGUID := routing.URLParam(r, "guid")

appListDroplets := new(payloads.AppListDroplets)

app, err := h.appRepo.GetApp(r.Context(), authInfo, appGUID)
if err != nil {
return nil, apierrors.LogAndReturn(logger, apierrors.ForbiddenAsNotFound(err), "Failed to fetch app from Kubernetes", "AppGUID", appGUID)
}

dropletListMessage := appListDroplets.ToMessage([]string{appGUID})
droplets, err := h.dropletRepo.ListDroplets(r.Context(), authInfo, dropletListMessage)
droplets, err := h.dropletRepo.ListDroplets(r.Context(), authInfo, repositories.ListDropletsMessage{AppGUIDs: []string{appGUID}})
if err != nil {
return nil, apierrors.LogAndReturn(logger, apierrors.ForbiddenAsNotFound(err), "Failed to fetch droplet from Kubernetes", "dropletGUID", app.DropletGUID)
}
Expand Down
8 changes: 0 additions & 8 deletions api/payloads/app.go
Original file line number Diff line number Diff line change
Expand Up @@ -204,11 +204,3 @@ func (a *AppPatch) ToMessage(appGUID, spaceGUID string) repositories.PatchAppMes

return msg
}

type AppListDroplets struct{}

func (a *AppListDroplets) ToMessage(appGUIDs []string) repositories.ListDropletsMessage {
return repositories.ListDropletsMessage{
AppGUIDs: appGUIDs,
}
}

0 comments on commit f57142e

Please sign in to comment.