import { Component, OnInit } from '@angular/core';
import { NbDialogRef } from '@nebular/theme';
import { PageapiService } from '../../pageapi.service';

@Component({
  selector: 'ngx-view-details',
  templateUrl: './view-details.component.html',
  styleUrls: ['./view-details.component.scss']
})
export class ViewDetailsComponent implements OnInit {
  products:any =[];
  constructor(private dialogRef: NbDialogRef<ViewDetailsComponent>,public _api:PageapiService) { }

  ngOnInit(): void {

    console.log('dialogRef', this.dialogRef.componentRef.instance);
    let details:any = this.dialogRef.componentRef.instance

    

    let  param ={orderId:details.details.orderId}
  
   
    
   
  
 
     
    this._api.getProductList (param).subscribe(res => {
      if (res.status == 200) {

        this.products = res.data

      }
    })
  }

  close(){
    this.dialogRef.close(0)
  }

}
