Refactor calls to ussd service.

This commit is contained in:
Spencer Ofwiti 2021-05-26 10:26:11 +03:00
parent cef7b8dc04
commit 9782c919d5
2 changed files with 3 additions and 3 deletions

View File

@ -52,7 +52,7 @@ export class UserService {
resetPin(phone: string): Observable<any> {
const params: HttpParams = new HttpParams().set('phoneNumber', phone);
return this.httpClient.get(`${environment.cicUssdUrl}/pin`, { params });
return this.httpClient.put(`${environment.cicUssdUrl}/pin`, { params });
}
getAccountStatus(phone: string): Observable<any> {

View File

@ -109,8 +109,6 @@ export class AccountDetailsComponent implements OnInit {
this.account = res;
this.cdr.detectChanges();
this.loggingService.sendInfoLevelMessage(this.account);
// this.userService.getAccountStatus(this.account.vcard?.tel[0].value).pipe(first())
// .subscribe(response => this.accountStatus = response);
this.accountInfoForm.patchValue({
name: this.account.vcard?.fn[0].value,
phoneNumber: this.account.vcard?.tel[0].value,
@ -123,6 +121,8 @@ export class AccountDetailsComponent implements OnInit {
location: this.account.location.area,
locationType: this.account.location.area_type,
});
this.userService.getAccountStatus(this.account.vcard?.tel[0].value).pipe(first())
.subscribe(response => this.accountStatus = response.status);
} else {
alert('Account not found!');
}