fix(admin): setup converter only adds domain if set (#358)

This commit is contained in:
Silvan 2020-07-07 12:57:45 +02:00 committed by GitHub
parent b8798230b0
commit a6ffb120fa
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -19,10 +19,15 @@ func setUpRequestToModel(setUp *OrgSetUpRequest) *admin_model.SetupOrg {
} }
func orgCreateRequestToModel(org *CreateOrgRequest) *org_model.Org { func orgCreateRequestToModel(org *CreateOrgRequest) *org_model.Org {
return &org_model.Org{ o := &org_model.Org{
Domains: []*org_model.OrgDomain{&org_model.OrgDomain{Domain: org.Domain}}, Domains: []*org_model.OrgDomain{},
Name: org.Name, 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 { func userCreateRequestToModel(user *CreateUserRequest) *usr_model.User {