diff --git a/app/controllers/api/v1/accounts/campaigns_controller.rb b/app/controllers/api/v1/accounts/campaigns_controller.rb index c4555017d..5c58d3f51 100644 --- a/app/controllers/api/v1/accounts/campaigns_controller.rb +++ b/app/controllers/api/v1/accounts/campaigns_controller.rb @@ -10,6 +10,11 @@ class Api::V1::Accounts::CampaignsController < Api::V1::Accounts::BaseController @campaign = Current.account.campaigns.create!(campaign_params) end + def destroy + @campaign.destroy + head :ok + end + def show; end def update diff --git a/app/javascript/dashboard/i18n/locale/en/campaign.json b/app/javascript/dashboard/i18n/locale/en/campaign.json index 2eed61b19..f1c249669 100644 --- a/app/javascript/dashboard/i18n/locale/en/campaign.json +++ b/app/javascript/dashboard/i18n/locale/en/campaign.json @@ -42,6 +42,19 @@ "ERROR_MESSAGE": "There was an error. Please try again." } }, + "DELETE": { + "BUTTON_TEXT": "Delete", + "CONFIRM": { + "TITLE": "Confirm Deletion", + "MESSAGE": "Are you sure to delete?", + "YES": "Yes, Delete ", + "NO": "No, Keep " + }, + "API": { + "SUCCESS_MESSAGE": "Campaign deleted successfully", + "ERROR_MESSAGE": "Could not delete the campaign. Please try again later." + } + }, "EDIT": { "TITLE": "Edit campaign", "UPDATE_BUTTON_TEXT": "Update", diff --git a/app/javascript/dashboard/routes/dashboard/settings/inbox/components/AddCampaign.vue b/app/javascript/dashboard/routes/dashboard/settings/inbox/components/AddCampaign.vue index 70be87feb..ea067fa3e 100644 --- a/app/javascript/dashboard/routes/dashboard/settings/inbox/components/AddCampaign.vue +++ b/app/javascript/dashboard/routes/dashboard/settings/inbox/components/AddCampaign.vue @@ -1,132 +1,112 @@