@@ -119,13 +119,13 @@ type findStatusQuery struct {
119119 Identity string `bson:"identity,omitempty"`
120120}
121121
122- func newPersonalAccountQuery (identity string , status int ) bson.M {
122+ func newTechAccountQuery (identity string , status int ) bson.M {
123123 return bson.M {
124124 "identity" : identity ,
125125 "$and" : []bson.M {
126126 {
127127 "$or" : []bson.M {
128- {"type" : SpaceTypePersonal },
128+ {"type" : SpaceTypeTech },
129129 {"type" : bson.M {"$exists" : false }},
130130 },
131131 },
@@ -174,7 +174,7 @@ func (s *spaceStatus) AccountDelete(ctx context.Context, payload AccountDeletion
174174 toBeDeletedTimestamp = tm .Add (s .deletionPeriod ).Unix ()
175175 )
176176 err = s .db .Tx (ctx , func (txCtx mongo.SessionContext ) error {
177- // Find personal space with SpaceStatusCreated status for the given identity
177+ // Find tech space with SpaceStatusCreated status for the given identity
178178 if ! s .accountStatusFindTx (txCtx , identity , SpaceStatusCreated ) {
179179 return coordinatorproto .ErrAccountIsDeleted
180180 }
@@ -270,9 +270,6 @@ func (s *spaceStatus) SpaceDelete(ctx context.Context, payload SpaceDeletion) (t
270270 return coordinatorproto .ErrSpaceNotExists
271271 }
272272 switch spType {
273- case SpaceTypePersonal :
274- log .Debug ("cannot delete personal space" , zap .Error (err ), zap .String ("spaceId" , payload .SpaceId ))
275- return coordinatorproto .ErrUnexpected
276273 case SpaceTypeTech :
277274 log .Debug ("cannot delete tech space" , zap .Error (err ), zap .String ("spaceId" , payload .SpaceId ))
278275 return coordinatorproto .ErrUnexpected
@@ -413,7 +410,7 @@ func (s *spaceStatus) Status(ctx context.Context, spaceId string) (entry StatusE
413410}
414411
415412func (s * spaceStatus ) accountStatusFindTx (txCtx mongo.SessionContext , identity string , status int ) (found bool ) {
416- err := s .spaces .FindOne (txCtx , newPersonalAccountQuery (identity , status )).Err ()
413+ err := s .spaces .FindOne (txCtx , newTechAccountQuery (identity , status )).Err ()
417414 if err == nil {
418415 return true
419416 }
0 commit comments