diff --git a/cmd/campaigns.go b/cmd/campaigns.go
index fac1879..106bfcf 100644
--- a/cmd/campaigns.go
+++ b/cmd/campaigns.go
@@ -416,13 +416,6 @@ func handleDeleteCampaign(c echo.Context) error {
fmt.Sprintf("Error fetching campaign: %s", pqErrMsg(err)))
}
- // Only scheduled campaigns can be deleted.
- if cm.Status != models.CampaignStatusDraft &&
- cm.Status != models.CampaignStatusScheduled {
- return echo.NewHTTPError(http.StatusBadRequest,
- "Only campaigns that haven't been started can be deleted.")
- }
-
if _, err := app.queries.DeleteCampaign.Exec(cm.ID); err != nil {
app.log.Printf("error deleting campaign: %v", err)
return echo.NewHTTPError(http.StatusInternalServerError,
diff --git a/frontend/src/views/Campaigns.vue b/frontend/src/views/Campaigns.vue
index fe7d22b..4f89663 100644
--- a/frontend/src/views/Campaigns.vue
+++ b/frontend/src/views/Campaigns.vue
@@ -177,8 +177,7 @@
- deleteCampaign(props.row))">
@@ -239,9 +238,6 @@ export default Vue.extend({
canResume(c) {
return c.status === 'paused';
},
- canDelete(c) {
- return c.status === 'draft' || c.status === 'scheduled';
- },
isSheduled(c) {
return c.status === 'scheduled' || c.sendAt !== null;
},
diff --git a/queries.sql b/queries.sql
index 9769205..a07da15 100644
--- a/queries.sql
+++ b/queries.sql
@@ -586,7 +586,7 @@ WHERE id=$1;
UPDATE campaigns SET status=$2, updated_at=NOW() WHERE id = $1;
-- name: delete-campaign
-DELETE FROM campaigns WHERE id=$1 AND (status = 'draft' OR status = 'scheduled');
+DELETE FROM campaigns WHERE id=$1;
-- name: register-campaign-view
WITH view AS (