import {Component, OnInit, ViewChild} from '@angular/core'; import {NavController} from "@ionic/angular"; import {Router} from "@angular/router"; import {SessionDataProviderService} from "../../store/session-data-provider.service"; import {WrenchService} from "../../services/wrench.service"; @Component({ selector: 'app-resetpass', templateUrl: './resetpass.page.html', styleUrls: ['./resetpass.page.scss'], }) export class ResetpassPage implements OnInit { @ViewChild('curr_pass') curr_pass; @ViewChild('new_pass') new_pass; @ViewChild('confirm_new_pass') confirm_new_pass; tabs = 'about'; constructor( private navctr: NavController, private router: Router, public sessionDataProviderService: SessionDataProviderService, private wrenchService: WrenchService ) { } ngOnInit() { } onBack() { this.navctr.back(); } onResetPass() { if( this.curr_pass !='' && this.new_pass !='' && this.confirm_new_pass !='' && this.new_pass.length > 7 && this.curr_pass.length > 5 && (this.confirm_new_pass==this.new_pass) ){ this.sendPassReset(); } else { return; } } /* 'member_id' => int 1 'sessionid' => string '936571FD2E081B667930E7FFDF4D819938171883CA0CC951DC6C4FB184280EB3' (length=64) 'uid' => string '3119b744-42ad-4834-bb83-b737588754ca' (length=36) 'current_pass' => string 'valid_current_pass' (length=18) 'new_pass' => string 'valid_new_pass' (length=14) 'action' => int 11005 */ //profilePassChange(reqData) reqData: { action:number, member_id: number, uid: string, sessionid: string, current_pass:string, new_pass:string }; passResetResult:any; sendPassReset(){ this.reqData = {action:11005, member_id: this.sessionDataProviderService.member_id, uid: this.sessionDataProviderService.member_uid, sessionid: this.sessionDataProviderService.session , current_pass:this.curr_pass, new_pass:this.new_pass} this.wrenchService.profilePassChange(this.reqData).subscribe( passResetResult => { this.passResetResult = passResetResult; console.log("passResetResult RETURN->", this.passResetResult); } ); } }