mirror of
https://gitlab.silvrtree.co.uk/martind2000/censis-obrand.git
synced 2025-02-06 23:39:16 +00:00
35 lines
817 B
JavaScript
35 lines
817 B
JavaScript
'use strict';
|
|
import Ember from 'ember';
|
|
const { service } = Ember.inject;
|
|
export default Ember.Controller.extend({
|
|
session: service('session'),
|
|
sessionAccount: service('session-account'),
|
|
actions: {
|
|
saveCompany: function() {
|
|
|
|
console.log('save company');
|
|
|
|
var model = this.get('model');
|
|
var account = this.get('sessionAccount.account');
|
|
|
|
console.log(model.get('company_name'));
|
|
|
|
model.set('uid', this.get('sessionAccount.account.uid'));
|
|
|
|
model.save()
|
|
.then(function(d) {
|
|
console.log(d);
|
|
|
|
account.set('memberof', model.get('cid'));
|
|
|
|
})
|
|
.catch(function(err) {
|
|
console.log(err);
|
|
});
|
|
// This.set('isEditing', false);
|
|
|
|
//this.transitionTo('company');
|
|
}
|
|
}
|
|
});
|