mirror of
https://github.com/fleetdm/fleet
synced 2026-05-22 00:18:27 +00:00
Fix saving of teams in invitations (#632)
This commit is contained in:
parent
cdf43a79bd
commit
db11f7b6aa
3 changed files with 3 additions and 1 deletions
|
|
@ -31,6 +31,7 @@ func (d *Datastore) NewInvite(i *kolide.Invite) (*kolide.Invite, error) {
|
|||
i.ID = uint(id)
|
||||
|
||||
if len(i.Teams) == 0 {
|
||||
i.Teams = []kolide.UserTeam{}
|
||||
return i, nil
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -52,7 +52,7 @@ type InvitePayload struct {
|
|||
Position *string
|
||||
SSOEnabled *bool `json:"sso_enabled"`
|
||||
GlobalRole null.String `json:"global_role"`
|
||||
Teams []UserTeam `json:"teams,omitempty"`
|
||||
Teams []UserTeam `json:"teams"`
|
||||
}
|
||||
|
||||
// Invite represents an invitation for a user to join Fleet.
|
||||
|
|
|
|||
|
|
@ -39,6 +39,7 @@ func (svc service) InviteNewUser(ctx context.Context, payload kolide.InvitePaylo
|
|||
InvitedBy: inviter.ID,
|
||||
Token: token,
|
||||
GlobalRole: payload.GlobalRole,
|
||||
Teams: payload.Teams,
|
||||
}
|
||||
if payload.Position != nil {
|
||||
invite.Position = *payload.Position
|
||||
|
|
|
|||
Loading…
Reference in a new issue