import { Component, OnInit } from '@angular/core';
import { Router } from '@angular/router';
import { HitAWodService } from 'src/app/services/hit-a-wod.service';

@Component({
  selector: 'app-forgot-password',
  templateUrl: './forgot-password.component.html',
  styleUrls: ['./forgot-password.component.css']
})
export class ForgotPasswordComponent implements OnInit {

  email:string;

  constructor(private router:Router,
              private api:HitAWodService) { }

  ngOnInit(): void {
  }

  forgot() {
    this.api.sendResetPasswordRequest(this.email).subscribe(
      data => {
        this.router.navigate(["/auth", "change-password"]);
      }
    );
  }

}
