mirror of
https://github.com/empayre/fleet.git
synced 2024-11-06 17:05:18 +00:00
19 lines
432 B
Go
19 lines
432 B
Go
package service
|
|
|
|
import (
|
|
"context"
|
|
|
|
"github.com/fleetdm/fleet/v4/server/fleet"
|
|
)
|
|
|
|
func (mw validationMiddleware) InviteNewUser(ctx context.Context, payload fleet.InvitePayload) (*fleet.Invite, error) {
|
|
invalid := &fleet.InvalidArgumentError{}
|
|
if payload.Email == nil {
|
|
invalid.Append("email", "missing required argument")
|
|
}
|
|
if invalid.HasErrors() {
|
|
return nil, invalid
|
|
}
|
|
return mw.Service.InviteNewUser(ctx, payload)
|
|
}
|