From a6ffb120fac66a03e75ba72637c263a682145b10 Mon Sep 17 00:00:00 2001 From: Silvan Date: Tue, 7 Jul 2020 12:57:45 +0200 Subject: [PATCH] fix(admin): setup converter only adds domain if set (#358) --- pkg/admin/api/grpc/org_converter.go | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/pkg/admin/api/grpc/org_converter.go b/pkg/admin/api/grpc/org_converter.go index 4d24456c9f..44b161297f 100644 --- a/pkg/admin/api/grpc/org_converter.go +++ b/pkg/admin/api/grpc/org_converter.go @@ -19,10 +19,15 @@ func setUpRequestToModel(setUp *OrgSetUpRequest) *admin_model.SetupOrg { } func orgCreateRequestToModel(org *CreateOrgRequest) *org_model.Org { - return &org_model.Org{ - Domains: []*org_model.OrgDomain{&org_model.OrgDomain{Domain: org.Domain}}, + o := &org_model.Org{ + Domains: []*org_model.OrgDomain{}, Name: org.Name, } + if org.Domain != "" { + o.Domains = append(o.Domains, &org_model.OrgDomain{Domain: org.Domain}) + } + + return o } func userCreateRequestToModel(user *CreateUserRequest) *usr_model.User {