mirror of
https://gitlab.silvrtree.co.uk/martind2000/project.git
synced 2025-01-10 23:35:08 +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);
|
|
|
|
}
|
|
}
|
|
|
|
});
|