mirror of
https://github.com/empayre/fleet.git
synced 2024-11-06 17:05:18 +00:00
set created_at time for invites in inmem (#588)
This commit is contained in:
parent
62a5e65c2e
commit
02945f1e3b
@ -2,6 +2,7 @@ package inmem
|
||||
|
||||
import (
|
||||
"sort"
|
||||
"time"
|
||||
|
||||
"github.com/kolide/kolide-ose/server/errors"
|
||||
"github.com/kolide/kolide-ose/server/kolide"
|
||||
@ -18,6 +19,11 @@ func (orm *Datastore) NewInvite(invite *kolide.Invite) (*kolide.Invite, error) {
|
||||
}
|
||||
}
|
||||
|
||||
// set time if missing.
|
||||
if invite.CreatedAt.IsZero() {
|
||||
invite.CreatedAt = time.Now()
|
||||
}
|
||||
|
||||
invite.ID = uint(len(orm.invites) + 1)
|
||||
orm.invites[invite.ID] = invite
|
||||
return invite, nil
|
||||
|
Loading…
Reference in New Issue
Block a user