Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
}, () => {
notify('There has been an error amending the interaction.', 'error');
})
});
}).then(successCallback, () => {
notify('The interaction could not be cancelled.', 'error');
})
});
}, () => {
notify('There has been an error rescheduling the interaction.', 'error');
model.rollback();
this.transitionToRoute('dashboard.interaction', this.get('model.id'));
})
}));
}).catch(function() {
notify('There has been an error sending your email.', 'error');
});
},
Ember.onerror = function(error) {
var status;
if (error.jqXHR != null) {
status = error.jqXHR.status;
} else {
status = error.status;
}
if (status >= 500) {
notify('Something went wrong with that request, please try again.', 'error');
}
logError(error);
};
}
InteractionCancellation.create().cancel(this.get('model'), response => {
notify('The interaction has been cancelled.');
this.store.pushPayload(response);
this.get('dashboard').propertyDidChange('scheduledInteractions');
this.get('sidePanel').send('close');
}, withdrawFromCompliance);
completionForm.save().then(() => {
notify('The interaction has been completed.');
completionForm.set('editingDisabled', true);
});
},
promise: this.get('model').save().catch(() => {
if (this.get('model.errors.length') > 0) {
this.set('errors', this.get('model.errors'));
} else {
notify(this.get('genericErrorMessage'), 'error');
}
return Ember.RSVP.Promise.reject();
})
});