checkin demo api key

pull/496/head
hunterlong 2020-04-14 10:26:33 -07:00
parent 36feac4d2f
commit dbdf92411f
3 changed files with 6 additions and 4 deletions

View File

@ -23,7 +23,7 @@ var testCheckin = &Checkin{
var testCheckinHits = []*CheckinHit{{
Checkin: 1,
From: "0.0.0.0.0",
From: "0.0.0.0",
CreatedAt: utils.Now().Add(-30 * time.Second),
}, {
Checkin: 2,

View File

@ -32,7 +32,9 @@ func All() []*Checkin {
}
func (c *Checkin) Create() error {
c.ApiKey = utils.RandomString(32)
if c.ApiKey == "" {
c.ApiKey = utils.RandomString(32)
}
q := db.Create(c)
c.Start()

View File

@ -7,11 +7,11 @@ import (
func Samples() error {
checkin1 := &Checkin{
Name: "Example Checkin 1",
Name: "Demo Checkin 1",
ServiceId: 1,
Interval: 300,
GracePeriod: 300,
ApiKey: utils.RandomString(7),
ApiKey: "demoCheckin123",
}
if err := checkin1.Create(); err != nil {
return err