close modal once done

This commit is contained in:
Sam Saffron 2017-02-07 17:00:15 -05:00
parent f2d31b83a2
commit 67169fd0e5
2 changed files with 5 additions and 2 deletions

View File

@ -7,7 +7,7 @@ export default {
actions: { actions: {
assign(){ assign(){
showModal("assign-user"); showModal("assign-user", { model: this.topic });
} }
} }
}; };

View File

@ -13,7 +13,10 @@ export default Ember.Controller.extend({
assign(){ assign(){
return ajax('/assign/assign',{ return ajax('/assign/assign',{
type: 'PUT', type: 'PUT',
data: { username: this.get('username'), topic_id: 1 } data: { username: this.get('username'), topic_id: this.get('model.id') }
}).then((user)=>{
console.log(user);
this.send('closeModal');
}).catch(popupAjaxError); }).catch(popupAjaxError);
} }
} }