Skip to content

Commit

Permalink
feat(cli,api): update namespace Type field processing
Browse files Browse the repository at this point in the history
  • Loading branch information
haller33 committed Nov 11, 2024
1 parent 8be1dfa commit 925c681
Show file tree
Hide file tree
Showing 8 changed files with 427 additions and 43 deletions.
7 changes: 7 additions & 0 deletions api/services/namespace.go
Original file line number Diff line number Diff line change
Expand Up @@ -64,12 +64,19 @@ func (s *service) CreateNamespace(ctx context.Context, req *requests.NamespaceCr
ConnectionAnnouncement: "",
},
TenantID: req.TenantID,
Type: models.NewDefaultType(),
}

if envs.IsCommunity() {
ns.Settings.ConnectionAnnouncement = models.DefaultAnnouncementMessage
}

if models.IsTypeTeam(req.Type) {
ns.Type = models.TypeTeam
} else if models.IsTypePersonal(req.Type) {
ns.Type = models.TypePersonal
}

if req.TenantID == "" {
ns.TenantID = uuid.Generate()
}
Expand Down
Loading

0 comments on commit 925c681

Please sign in to comment.