Skip to content

Commit

Permalink
Merge pull request #57 from tailorsoft/EC-100126-add-signup-event
Browse files Browse the repository at this point in the history
EC-100126 add signUp and update event
  • Loading branch information
danieltaylor-nz committed Nov 6, 2020
2 parents 7ac61ce + cc54c7e commit 0e0f833
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 0 deletions.
2 changes: 2 additions & 0 deletions AUTHORS
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@ Written in 2019 by Sergio Loaiza - serloap
Written in 2019 by Alex Bravo - alexbravotsoft
Written in 2020 by Lombardo Paredes - lombardo2
Written in 2020 by Andres Urrea - landresul
Written in 2020 by Frayba Otalora - fraybaotalora


===========================================================================
Expand Down Expand Up @@ -75,3 +76,4 @@ Written in 2019 by Alex Bravo - alexbravotsoft
Written in 2020 by Lombardo Paredes - lombardo2
Written in 2020 by Andres Urrea - landresul
Written in 2020 by Andres Ortega - elarcanista
Written in 2020 by Frayba Otalora - fraybaotalora
9 changes: 9 additions & 0 deletions screen/store/components/ComponentsAccount.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
/* This software is in the public domain under CC0 1.0 Universal plus a Grant of Patent License. */
var STORE_COUNTRY = "USA";
var ACCOUNT_CREATED = "accountCreated";
var ACCOUNT_UPDATED = "accountUpdated";


storeComps.LoginPage = {
name: "login",
Expand Down Expand Up @@ -241,6 +244,9 @@ storeComps.AccountPage = {
this.setCustomerInfo(data.customerInfo);
this.message.state = 1;
this.message.message = "Correct! Your data has been updated.";
var event = new CustomEvent(ACCOUNT_UPDATED, { detail : {"firstName": this.customerInfo.firstName.trim(), "lastName": this.customerInfo.lastName.trim(),
"emailAddress": this.customerInfo.emailAddress.trim()}});
window.dispatchEvent(event);
}.bind(this));
},
setCustomerInfo: function(data) {
Expand Down Expand Up @@ -430,6 +436,9 @@ storeComps.CreateAccountPage = {
this.accountInfo.newPasswordVerify = this.confirmPassword;

LoginService.createAccount(this.accountInfo, this.axiosConfig).then(function (data) {
var event = new CustomEvent(ACCOUNT_CREATED, { detail : {"firstName": this.accountInfo.firstName.trim(), "lastName": this.accountInfo.lastName.trim(),
"emailAddress": this.accountInfo.emailAddress.trim()}});
window.dispatchEvent(event);
this.login(this.accountInfo.emailAddress, this.accountInfo.newPassword);
}.bind(this)).catch(function (error) {
if(!!error.response && !!error.response.headers){
Expand Down

0 comments on commit 0e0f833

Please sign in to comment.