diff --git a/cmd/archive.go b/cmd/archive.go index 197f79a08..348b4000d 100644 --- a/cmd/archive.go +++ b/cmd/archive.go @@ -17,6 +17,7 @@ type campArchive struct { UUID string `json:"uuid"` Subject string `json:"subject"` CreatedAt null.Time `json:"created_at"` + SendAt null.Time `json:"send_at"` URL string `json:"url"` } @@ -169,6 +170,7 @@ func getCampaignArchives(offset, limit int, app *App) ([]campArchive, int, error UUID: camp.UUID, Subject: camp.Subject, CreatedAt: camp.CreatedAt, + SendAt: camp.SendAt, URL: app.constants.ArchiveURL + "/" + camp.UUID, }) } diff --git a/queries.sql b/queries.sql index 6300079a5..7ff286bd4 100644 --- a/queries.sql +++ b/queries.sql @@ -517,7 +517,7 @@ SELECT campaigns.*, WHERE CASE WHEN $1 > 0 THEN campaigns.id = $1 ELSE uuid = $2 END; -- name: get-archived-campaigns -SELECT COUNT(*) OVER () AS total, id, uuid, subject, archive_meta, created_at FROM campaigns +SELECT COUNT(*) OVER () AS total, id, uuid, subject, archive_meta, created_at, send_at FROM campaigns WHERE archive=true AND type='regular' AND status=ANY('{running, paused, finished}') ORDER by created_at DESC OFFSET $1 LIMIT $2; diff --git a/static/public/templates/archive.html b/static/public/templates/archive.html index 315464884..5f4a8863d 100644 --- a/static/public/templates/archive.html +++ b/static/public/templates/archive.html @@ -7,7 +7,13 @@