diff --git a/account/accountusecase/accountinteractor/workspace.go b/account/accountusecase/accountinteractor/workspace.go index 6822526..288a6a3 100644 --- a/account/accountusecase/accountinteractor/workspace.go +++ b/account/accountusecase/accountinteractor/workspace.go @@ -232,6 +232,10 @@ func (i *Workspace) RemoveMultipleUserMembers(ctx context.Context, id workspace. return nil, accountinterfaces.ErrInvalidOperator } + if userIds.Len() == 0 { + return nil, accountinterfaces.ErrNoUsersSpecified + } + return Run1(ctx, operator, i.repos, Usecase().Transaction(), func(ctx context.Context) (*workspace.Workspace, error) { ws, err := i.repos.Workspace.FindByID(ctx, id) if err != nil { diff --git a/account/accountusecase/accountinterfaces/common.go b/account/accountusecase/accountinterfaces/common.go index 3f780f2..905352f 100644 --- a/account/accountusecase/accountinterfaces/common.go +++ b/account/accountusecase/accountinterfaces/common.go @@ -8,4 +8,5 @@ import ( var ( ErrOperationDenied error = rerror.NewE(i18n.T("operation denied")) ErrInvalidOperator error = rerror.NewE(i18n.T("invalid operator")) + ErrNoUsersSpecified error = rerror.NewE(i18n.T("no users specified for removal")) )