import {Component, OnInit, ChangeDetectionStrategy, Output, EventEmitter} from '@angular/core';
import {createQueryStringFromObject} from '../../../../../../shared/util/func';

@Component({
    selector: 'app-education-type-search',
    templateUrl: './education-type-search.component.html',
    styleUrls: ['./education-type-search.component.scss'],
    changeDetection: ChangeDetectionStrategy.OnPush
})
export class EducationTypeSearchComponent implements OnInit {
    query = {
        education_type_name_th: null
    };
    @Output() search = new EventEmitter();
    @Output() add = new EventEmitter();
    constructor(
    ) { }

    ngOnInit(): void {
    }
    onSearch(){
        let query = createQueryStringFromObject(this.query);
        this.search.emit(query);
    }

    clear(){
        this.query = {
            education_type_name_th: null
        };
    }

    onAdd(){
        this.add.emit();
    }

}
