Skip to content

Commit

Permalink
GO-3631 Return first space on account create
Browse files Browse the repository at this point in the history
  • Loading branch information
mcrakhman committed Sep 25, 2024
1 parent 5a15215 commit 9c06942
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
7 changes: 5 additions & 2 deletions core/application/account_create.go
Original file line number Diff line number Diff line change
Expand Up @@ -103,12 +103,16 @@ func (s *Service) handleCustomStorageLocation(req *pb.RpcAccountCreateRequest, a
}

func (s *Service) setAccountAndProfileDetails(ctx context.Context, req *pb.RpcAccountCreateRequest, newAcc *model.Account) error {
techSpaceId := app.MustComponent[space.Service](s.app).TechSpaceId()
spaceService := app.MustComponent[space.Service](s.app)
techSpaceId := spaceService.TechSpaceId()
personalSpaceId := spaceService.PersonalSpaceId()
var err error
newAcc.Info, err = app.MustComponent[account.Service](s.app).GetInfo(ctx)
if err != nil {
return err
}
// TODO: remove it release 8, this is need for client to set "My First Space" as space name
newAcc.Info.AccountSpaceId = personalSpaceId

bs := s.app.MustComponent(block.CName).(*block.Service)
commonDetails := []*model.Detail{
Expand Down Expand Up @@ -141,7 +145,6 @@ func (s *Service) setAccountAndProfileDetails(ctx context.Context, req *pb.RpcAc
})
}
}
spaceService := app.MustComponent[space.Service](s.app)
accId, err := spaceService.TechSpace().AccountObjectId()
if err != nil {
return errors.Join(ErrSetDetails, err)
Expand Down
1 change: 1 addition & 0 deletions space/service.go
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,7 @@ type Service interface {
Wait(ctx context.Context, spaceId string) (sp clientspace.Space, err error)
Delete(ctx context.Context, id string) (err error)
TechSpaceId() string
PersonalSpaceId() string
TechSpace() *clientspace.TechSpace
GetPersonalSpace(ctx context.Context) (space clientspace.Space, err error)
GetTechSpace(ctx context.Context) (space clientspace.Space, err error)
Expand Down

0 comments on commit 9c06942

Please sign in to comment.