mirror of
https://gitlab.silvrtree.co.uk/martind2000/project.git
synced 2025-01-25 21:16:17 +00:00
24 lines
619 B
JavaScript
24 lines
619 B
JavaScript
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() {
|
|
'use strict';
|
|
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);
|
|
|
|
}
|
|
}
|
|
});
|