import { HttpErrorResponse } from '@angular/common/http';
import { Component, Inject, OnInit } from '@angular/core';
import { FormGroup, FormControl, Validators } from '@angular/forms';
import { MatDialogRef, MAT_DIALOG_DATA } from '@angular/material/dialog';
import { lastValueFrom } from 'rxjs';
import { GETBGTService } from 'src/app/services/getb/getbgt/getbgt.service';
import { GETBREService } from 'src/app/services/getb/getbre/getbre.service';
import { ResourcesService } from 'src/app/services/resources/resources.service';

@Component({
  selector: 'app-getbtb-advance-query',
  templateUrl: './table-dyn-management-advance-query.component.html',
  styleUrls: ['./table-dyn-management-advance-query.component.css'],
})
export class TableDynManagementAdvanceQuery implements OnInit {
  public formGroup: FormGroup;

  constructor(
    public dialogRef: MatDialogRef<any>,
    private _getbgtService: GETBGTService,
    private _resourceService: ResourcesService,
    private _getbreService: GETBREService,
    @Inject(MAT_DIALOG_DATA) public data: any
  ) {
    this.formGroup = this.createFormGroup();
  }

  private createFormGroup() {
    return new FormGroup({
      query: new FormControl('', Validators.required),
    });
  }

  ngOnInit(): void {}

  get query() {
    return this.formGroup.get('query');
  }
}
