diff --git a/handlers/workspace.go b/handlers/workspace.go index 6cc1728..8f86446 100644 --- a/handlers/workspace.go +++ b/handlers/workspace.go @@ -153,8 +153,11 @@ func (aH *AccessHandler) DeleteWorkspace(c *gin.Context) { c.JSON(http.StatusInternalServerError, nil) return } + for _, u := range users { - if u.Settings.Workspace.Name == workspace.Name { + if u.Workspaces == nil { + continue + } else if u.Settings.Workspace.Name == workspace.Name { u.Settings.Workspace = nil } @@ -163,13 +166,14 @@ func (aH *AccessHandler) DeleteWorkspace(c *gin.Context) { }) } - // crearemove folder + // remove folder err = os.RemoveAll(workspace.Uuid.String()) if err != nil { aH.logger.Error("DeleteWorkspace", err) c.JSON(http.StatusBadRequest, models.NewJsonErrorResponse(err)) return } + } c.JSON(http.StatusOK, gin.H{