This repository has been archived on 2023-03-18. You can view files and clone it, but cannot push or open issues or pull requests.
osr-discourse-src/app/assets/javascripts/discourse/controllers/queued-posts.js.es6

17 lines
374 B
JavaScript

import { popupAjaxError } from 'discourse/lib/ajax-error';
function updateState(state) {
return function(post) {
post.update({ state }).then(() => {
this.get('model').removeObject(post);
}).catch(popupAjaxError);
};
}
export default Ember.Controller.extend({
actions: {
approve: updateState('approved'),
reject: updateState('rejected')
}
});