refactor scopes to conform to public id usage and repo error msgs (#117)

This commit is contained in:
Jim authored and GitHub committed 2020-06-12 15:22:23 -04:00
1 parent 5c2cff3ad2
commit cc5114bdef
8 files changed
+152 -54

No files matched your search

+2 -2
View File
@@ -430,12 +430,12 @@ func (b *Server) CreateDevDatabase(dialect string) error {
}
}
scope, err = iam.NewOrganization(iam.WithPublicId(b.DefaultOrgId))
scope, err = iam.NewOrganization()
if err != nil {
c()
return fmt.Errorf("error creating new org scope: %w", err)
}
scope, err = repo.CreateScope(ctx, scope)
scope, err = repo.CreateScope(ctx, scope, iam.WithPublicId(b.DefaultOrgId))
if err != nil {
c()
return fmt.Errorf("error persisting new org scope: %w", err)