@@ -2,6 +2,7 @@ import Component from '@ember/component';
22import FormMixin from 'open-event-frontend/mixins/form' ;
33import { validPhoneNumber } from 'open-event-frontend/utils/validators' ;
44import { computed } from '@ember/object' ;
5+ import EmberObject from '@ember/object' ;
56
67export default Component . extend ( FormMixin , {
78
@@ -74,14 +75,36 @@ export default Component.extend(FormMixin, {
7475 }
7576 } ;
7677 } ,
77- user : computed ( function ( ) {
78- return this . authManager . currentUser ;
78+ user : computed ( 'authManager.currentUser' , function ( ) {
79+ const actualUser = this . authManager . currentUser ;
80+ let intermediateUser = EmberObject . create ( {
81+ billingContactName : actualUser . billingContactName ,
82+ billingCity : actualUser . billingCity ,
83+ billingPhone : actualUser . billingPhone ,
84+ company : actualUser . company ,
85+ billingTaxInfo : actualUser . billingTaxInfo ,
86+ billingAddress : actualUser . billingAddress ,
87+ billingZipCode : actualUser . billingZipCode ,
88+ billingAdditionalInfo : actualUser . billingAdditionalInfo
89+ } ) ;
90+ return intermediateUser ;
7991 } ) ,
8092 actions : {
8193 submit ( ) {
8294 this . onValid ( async ( ) => {
8395 try {
84- await this . user . save ( ) ;
96+ let actualUser = await this . authManager . currentUser ;
97+ actualUser . setProperties ( {
98+ billingAdditionalInfo : this . user . billingAdditionalInfo ,
99+ billingZipCode : this . user . billingZipCode ,
100+ billingContactName : this . user . billingContactName ,
101+ billingPhone : this . user . billingPhone ,
102+ company : this . user . company ,
103+ billingTaxInfo : this . user . billingTaxInfo ,
104+ billingCity : this . user . billingCity ,
105+ billingAddress : this . user . billingAddress
106+ } ) ;
107+ await actualUser . save ( ) ;
85108 this . notify . success ( this . l10n . t ( 'Your billing details has been updated' ) ) ;
86109 } catch ( error ) {
87110 this . notify . error ( this . l10n . t ( 'An unexpected error occurred' ) ) ;
0 commit comments