From e09015d2df245d0f31f3bb639b4159ae4871ba2d Mon Sep 17 00:00:00 2001 From: Jakub Novak Date: Thu, 8 Feb 2024 14:30:20 -0800 Subject: [PATCH] Fix response when no sandboxes are running --- VERSION | 2 +- packages/api/internal/handlers/sandboxes_list.go | 4 +++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/VERSION b/VERSION index 1d8b740d3..36e52555d 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -0.0.63 \ No newline at end of file +0.0.64 \ No newline at end of file diff --git a/packages/api/internal/handlers/sandboxes_list.go b/packages/api/internal/handlers/sandboxes_list.go index d19c57639..078404c5a 100644 --- a/packages/api/internal/handlers/sandboxes_list.go +++ b/packages/api/internal/handlers/sandboxes_list.go @@ -16,7 +16,7 @@ func (a *APIStore) GetSandboxes(c *gin.Context) { c.JSON(http.StatusOK, sandboxes) } -func (a *APIStore) GetSandboxesWithoutResponse(c *gin.Context) (sandboxes []api.RunningSandboxes) { +func (a *APIStore) GetSandboxesWithoutResponse(c *gin.Context) []api.RunningSandboxes { ctx := c.Request.Context() team := c.Value(constants.TeamContextKey).(models.Team) @@ -29,6 +29,8 @@ func (a *APIStore) GetSandboxesWithoutResponse(c *gin.Context) (sandboxes []api. properties := a.GetPackageToPosthogProperties(&c.Request.Header) CreateAnalyticsTeamEvent(a.posthog, team.ID.String(), "listed running instances", properties) + sandboxes := make([]api.RunningSandboxes, 0) + for _, info := range instanceInfo { if *info.TeamID != team.ID { continue