import { Component, OnInit } from '@angular/core';
import { BaseComponent } from '../base/base.component';
import { IResume } from './resume.model';
import { CvService } from '../services/cv.service';

@Component({
  selector: 'app-resume',
  templateUrl: './resume.component.html',
  styleUrl: './resume.component.scss'
})
export class ResumeComponent extends BaseComponent<IResume> implements OnInit {
  constructor(svc: CvService){
    super(svc);
  }

  ngOnInit(): void {
    this.getResume();
  }

  getResume(){
    this.svc.getResume(this.candidateId).subscribe((response: IResume) => {
        this.svc.resume = this.svc.resume ?? response;
        this.assignData(response);
    });
  }
}
