2016-04-06 15:53:06 +00:00
|
|
|
import Ember from 'ember';
|
|
|
|
const { service } = Ember.inject;
|
|
|
|
export default Ember.Controller.extend({
|
|
|
|
session: service('session'),
|
|
|
|
sessionAccount: service('session-account'),
|
|
|
|
genders: [{g: 'Male', id: 0}, {g: 'Female', id: 1}],
|
|
|
|
actions: {
|
|
|
|
editProfile: function() {
|
|
|
|
this.set('isEditing', true);
|
|
|
|
}, saveProfile: function() {
|
2016-04-07 15:45:00 +00:00
|
|
|
'use strict';
|
2016-04-06 15:53:06 +00:00
|
|
|
var model = this.get('model');
|
|
|
|
this.set('sessionAccount.account.forename', model.get('forename'));
|
|
|
|
|
|
|
|
this.model.save()
|
|
|
|
.catch(function(err) {
|
|
|
|
console.error(err);
|
|
|
|
});
|
|
|
|
this.set('isEditing', false);
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
});
|