fleet/server/service/validation_invites.go
Zach Wasserman 417ef2c9b6
Refactor teams service methods (#910)
- Move team-related service methods to `ee/server/service`.
- Instantiate different service on startup based on license key.
- Refactor service errors into separate package.
- Add support for running E2E tests in both Core and Basic tiers.
2021-05-31 17:07:51 -07:00

19 lines
433 B
Go

package service
import (
"context"
"github.com/fleetdm/fleet/server/kolide"
)
func (mw validationMiddleware) InviteNewUser(ctx context.Context, payload kolide.InvitePayload) (*kolide.Invite, error) {
invalid := &kolide.InvalidArgumentError{}
if payload.Email == nil {
invalid.Append("email", "missing required argument")
}
if invalid.HasErrors() {
return nil, invalid
}
return mw.Service.InviteNewUser(ctx, payload)
}