Improve message for token generation

This commit is contained in:
Rene Vergara 2023-01-04 14:50:52 -06:00
parent cbc3723814
commit 5b02ef0b0c
Signed by: pitmutt
GPG key ID: 65122AD495A7F5B2
2 changed files with 19 additions and 3 deletions

View file

@ -220,8 +220,24 @@ export class SettingsComponent implements OnInit {
}
generateWooToken(){
this.wooService.createWooToken(this.owner._id!);
this.wooService.getWooToken(this.owner._id!);
this.wooService.createWooToken(this.owner._id!).subscribe(responseData => {
if (responseData.status == 202) {
this.notifierService.showNotification("WooCommerce Token generated!", "Close", "success");
this.wooService.getWooToken(this.owner._id!);
this.wooOwnerUpdate.subscribe(owData => {
this.wooOwner = owData;
});
this.wooTokenUpdate.subscribe(tkData => {
this.wooToken = tkData;
});
this.wooUrlUpdate.subscribe(uData => {
this.wooUrl = uData;
});
close();
} else {
this.notifierService.showNotification("WooCommerce Token generation failed.", "Close", "error");
}
});
}
saveAccCod() {

View file

@ -60,6 +60,6 @@ export class WoocommerceService {
console.log('WooToken creation failed.');
}
});
return obs;
}
}