import { environment } from "src/environments/environment";
import { ICv } from "../models/cv.model";
import { CvService } from "../services/cv.service";

export abstract class BaseComponent<T extends object> {
    public model: T = <T>{};
    candidateId: number = 1;
    imagesOrigin: string = environment.apiUrl + '/images/';

    constructor(public svc: CvService) {
    }

    assignData(response: Partial<ICv> | unknown){
        Object.assign(this.model, response);
        if(this.svc.candidateAndSocialLinks == null){
            this.svc.getCandidateInfoSubject.next("");
        }
    }
}