import { Component, OnInit, ChangeDetectionStrategy } from '@angular/core';
import {StudentPaymentNotPaidService} from '../../../../../core/service/student-payment/student-payment-not-paid.service';

@Component({
  selector: 'app-register-cancel',
  templateUrl: './register-cancel.container.html',
  styleUrls: ['./register-cancel.container.scss'],
  changeDetection: ChangeDetectionStrategy.OnPush
})
export class RegisterCancelContainer implements OnInit {
  studentRegisterList$
  query
  constructor(
    private studentPaymentNotPaidSV: StudentPaymentNotPaidService,
  ) { }

  ngOnInit(): void {
  }

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

  getData(){
    if(this.query) return this.studentRegisterList$ = this.studentPaymentNotPaidSV.search(`?${this.query}`);
    if(!this.query) return this.studentRegisterList$ = this.studentPaymentNotPaidSV.getAll();
  }

}
