Skip to content

Commit

Permalink
Fix campaign start throwing error when disabling schedule on the UI.
Browse files Browse the repository at this point in the history
Closes #690
  • Loading branch information
knadh committed Feb 4, 2022
1 parent da30d46 commit 251c1ea
Showing 1 changed file with 10 additions and 6 deletions.
16 changes: 10 additions & 6 deletions frontend/src/views/Campaign.vue
Original file line number Diff line number Diff line change
Expand Up @@ -406,12 +406,7 @@ export default Vue.extend({
// Starts or schedule a campaign.
startCampaign() {
let status = '';
if (this.canStart) {
status = 'running';
} else if (this.canSchedule) {
status = 'scheduled';
} else {
if (!this.canStart && !this.canSchedule) {
return;
}
Expand All @@ -420,6 +415,15 @@ export default Vue.extend({
// First save the campaign.
this.updateCampaign().then(() => {
// Then start/schedule it.
let status = '';
if (this.canStart) {
status = 'running';
} else if (this.canSchedule) {
status = 'scheduled';
} else {
return;
}
this.$api.changeCampaignStatus(this.data.id, status).then(() => {
this.$router.push({ name: 'campaigns' });
});
Expand Down

0 comments on commit 251c1ea

Please sign in to comment.