fix success response handling of sending digest preview email

This commit is contained in:
Neil Lalonde 2016-11-24 15:05:33 -05:00
parent 6168b2c57a
commit f885e5b5e6
2 changed files with 2 additions and 1 deletions

View File

@ -12,6 +12,7 @@ export default Ember.Controller.extend({
const model = this.get('model'); const model = this.get('model');
this.set('loading', true); this.set('loading', true);
this.set('sentEmail', false);
EmailPreview.findDigest(this.get('lastSeen'), this.get('username')).then(email => { EmailPreview.findDigest(this.get('lastSeen'), this.get('username')).then(email => {
model.setProperties(email.getProperties('html_content', 'text_content')); model.setProperties(email.getProperties('html_content', 'text_content'));
this.set('loading', false); this.set('loading', false);

View File

@ -60,7 +60,7 @@ class Admin::EmailController < Admin::AdminController
message.to = params[:email] message.to = params[:email]
begin begin
Email::Sender.new(message, :digest).send Email::Sender.new(message, :digest).send
render nothing: true render json: success_json
rescue => e rescue => e
render json: {errors: [e.message]}, status: 422 render json: {errors: [e.message]}, status: 422
end end