mirror of
https://gitlab.silvrtree.co.uk/martind2000/project.git
synced 2025-01-10 23:45:07 +00:00
24 lines
628 B
JavaScript
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);
|
|
});
|
|
}
|
|
}
|
|
});
|