From e7f6a6490ae9f8042d67a10545e260ea6069cc0a Mon Sep 17 00:00:00 2001 From: ko_oler <kooler89@gmail.com> Date: Wed, 13 Dec 2023 17:24:41 +0300 Subject: [PATCH] =?UTF-8?q?=D0=BF=D1=80=D0=B0=D0=B2=D0=BA=D0=B0=20=D0=BF?= =?UTF-8?q?=D0=BE=20=D0=9F=D0=A0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- pkg/spaces/service.go | 2 +- pkg/spaces/space.go | 5 ++--- 2 files changed, 3 insertions(+), 4 deletions(-) diff --git a/pkg/spaces/service.go b/pkg/spaces/service.go index e77cd813..614ace0c 100644 --- a/pkg/spaces/service.go +++ b/pkg/spaces/service.go @@ -57,7 +57,7 @@ func IsSpaceAvailable(ctx context.Context, spcs Spaces, spaceId string) error { return errors.Wrap(err, "space not available") } - if spc.State != StateReady { + if spc.StateInfo.State != StateReady { return errors.New("space not available") } diff --git a/pkg/spaces/space.go b/pkg/spaces/space.go index b908bd7e..856cab0e 100644 --- a/pkg/spaces/space.go +++ b/pkg/spaces/space.go @@ -26,7 +26,6 @@ type Space struct { OrgID string `json:"org_id,omitempty" bson:"org_id"` Name string `json:"name,omitempty" bson:"name"` Description string `json:"desc,omitempty" bson:"desc"` - State State `json:"state" bson:"state"` StateInfo *StateInfo `json:"state_info,omitempty" bson:"state_info,omitempty"` // TransferToOrg - идентификатор организации, в которую был запрошен перенос пространства @@ -57,8 +56,8 @@ func (s Space) Fetch(i interface{}) interface{} { return s.Name case "Description": return s.Description - case "State": - return s.State + case "StateInfo": + return s.StateInfo case "Config": return s.Config default: -- GitLab