diff --git a/models/campaign.go b/models/campaign.go index 8f16a46e..875fc0c0 100644 --- a/models/campaign.go +++ b/models/campaign.go @@ -251,7 +251,7 @@ func PostCampaign(c *Campaign, uid int64) error { c.UserId = uid c.CreatedDate = time.Now() c.CompletedDate = time.Time{} - c.Status = CAMPAIGN_QUEUED + c.Status = CAMPAIGN_CREATED if c.LaunchDate.IsZero() { c.LaunchDate = time.Now() } @@ -323,7 +323,9 @@ func PostCampaign(c *Campaign, uid int64) error { c.Results = append(c.Results, *r) } } - return nil + c.Status = CAMPAIGN_QUEUED + err = db.Save(c).Error + return err } //DeleteCampaign deletes the specified campaign diff --git a/models/models.go b/models/models.go index 007216be..580da4d3 100644 --- a/models/models.go +++ b/models/models.go @@ -27,6 +27,7 @@ var Logger = log.New(os.Stdout, " ", log.Ldate|log.Ltime|log.Lshortfile) const ( CAMPAIGN_IN_PROGRESS string = "In progress" CAMPAIGN_QUEUED string = "Queued" + CAMPAIGN_CREATED string = "Created" CAMPAIGN_EMAILS_SENT string = "Emails Sent" CAMPAIGN_COMPLETE string = "Completed" EVENT_SENT string = "Email Sent"