Compare commits
2 commits
8b7172f8ab
...
5b02ef0b0c
Author | SHA1 | Date | |
---|---|---|---|
5b02ef0b0c | |||
cbc3723814 |
3 changed files with 20 additions and 4 deletions
|
@ -171,7 +171,7 @@
|
||||||
</mat-tab>
|
</mat-tab>
|
||||||
<mat-tab label="WooCommerce">
|
<mat-tab label="WooCommerce">
|
||||||
<div >
|
<div >
|
||||||
<div *ngIf="wooOwner == ''">
|
<div *ngIf="wooOwner == ''" align="center">
|
||||||
<button mat-raised-button color="primary" (click)="generateWooToken()">
|
<button mat-raised-button color="primary" (click)="generateWooToken()">
|
||||||
Generate Token
|
Generate Token
|
||||||
</button>
|
</button>
|
||||||
|
|
|
@ -220,8 +220,24 @@ export class SettingsComponent implements OnInit {
|
||||||
}
|
}
|
||||||
|
|
||||||
generateWooToken(){
|
generateWooToken(){
|
||||||
this.wooService.createWooToken(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.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() {
|
saveAccCod() {
|
||||||
|
|
|
@ -60,6 +60,6 @@ export class WoocommerceService {
|
||||||
console.log('WooToken creation failed.');
|
console.log('WooToken creation failed.');
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
return obs;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue