project/app/controllers/newcompany.js
2016-04-07 16:45:00 +01:00

24 lines
628 B
JavaScript

import Ember from 'ember';
const { service } = Ember.inject;
export default Ember.Controller.extend({
session: service('session'),
sessionAccount: service('session-account'),
actions: {
saveCompany: function() {
'use strict';
var model = this.get('model');
var account = this.get('sessionAccount.account');
model.set('uid', this.get('sessionAccount.account.uid'));
model.save()
.then(function() {
account.set('memberof', model.get('cid'));
})
.catch(function(err) {
console.error(err);
});
}
}
});