mirror of
https://gitlab.silvrtree.co.uk/martind2000/project.git
synced 2025-01-27 13:56:18 +00:00
25 lines
614 B
JavaScript
25 lines
614 B
JavaScript
|
'use strict';
|
||
|
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() {
|
||
|
|
||
|
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);
|
||
|
|
||
|
}
|
||
|
}
|
||
|
});
|