Fix campaign start throwing error when disabling schedule on the UI.
Closes #690
This commit is contained in:
parent
da30d4688e
commit
251c1ea64f
1 changed files with 10 additions and 6 deletions
|
@ -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;
|
||||
}
|
||||
|
||||
|
@ -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' });
|
||||
});
|
||||
|
|
Loading…
Reference in a new issue