mirror of
https://gitlab.silvrtree.co.uk/martind2000/censis-archive.git
synced 2025-01-31 10:50:14 +00:00
30 lines
651 B
JavaScript
30 lines
651 B
JavaScript
|
import Ember from 'ember';
|
||
|
const {service} = Ember.inject;
|
||
|
export default Ember.Controller.extend({
|
||
|
|
||
|
session: service('session'),
|
||
|
sessionAccount: service('session-account'),
|
||
|
actions: {
|
||
|
editCompany: function() {
|
||
|
this.set('isEditing', true);
|
||
|
}, saveCompany: function() {
|
||
|
'use strict';
|
||
|
this.set('isEditing', false);
|
||
|
var model = this.get('model');
|
||
|
|
||
|
model.save()
|
||
|
.catch(function(err) {
|
||
|
console.error(err);
|
||
|
});
|
||
|
|
||
|
}, cancelEdit: function() {
|
||
|
'use strict';
|
||
|
var model = this.get('model');
|
||
|
model.rollbackAttributes();
|
||
|
this.set('isEditing', false);
|
||
|
|
||
|
}
|
||
|
}
|
||
|
|
||
|
});
|