import {Component, OnInit, ChangeDetectionStrategy, ChangeDetectorRef} from '@angular/core';
import {Router} from '@angular/router';
import {TestingInformationService} from '../../../../core/service/testing-information/testing-information.service';
import {SweetalertService} from '../../../../core/service/sweetalert/sweetalert';
import {Observable} from 'rxjs';

@Component({
    selector: 'app-approve-examination',
    templateUrl: './approve-examination.container.html',
    styleUrls: ['./approve-examination.container.scss'],
    changeDetection: ChangeDetectionStrategy.OnPush
})
export class ApproveExaminationContainer implements OnInit {
    subjectList$ = new Observable();
    constructor(
        private router: Router,
        private TestinforSV: TestingInformationService,
        private cdr: ChangeDetectorRef,
        private swSV: SweetalertService
    ) { }

    ngOnInit(): void {
        this.subjectList$ = this.TestinforSV.getMaintrue();
    }

    search(query){
        if(query) return this.subjectList$ = this.TestinforSV.search(`?${query}`);
        if(!query) return this.subjectList$ = this.TestinforSV.getAll();
    }
}
