import { Component, OnInit,Input } from '@angular/core';
import {SessionDataProviderService} from "../../store/session-data-provider.service";
import {WrenchService} from "../../services/wrench.service";

@Component({
  selector: 'app-taskactivities',
  templateUrl: './taskactivities.component.html',
  styleUrls: ['./taskactivities.component.scss'],
})
export class TaskactivitiesComponent implements OnInit {
@Input('jobData') jobData:any;

  constructor(
      public sessionDataProviderService: SessionDataProviderService,
      private wrenchService: WrenchService
  ) { }

  ngOnInit() {
    console.log("IN COMPO ACT", this.jobData);
    this.activeJobMsgList();
  }
  contrData: {
    action:number,
    member_id: number,
    uid: string,
    sessionid: string,
    limit:20,
    contract:string,
    offset: 0
  };
  msgListTotalData:any;
  msgListData:any;

  activeJobMsgList(){
    this.contrData = {
      action:14011,
      member_id: this.sessionDataProviderService.member_id,
      uid: this.sessionDataProviderService.member_uid,
      sessionid: this.sessionDataProviderService.session ,
      limit:20,
      contract: this.jobData.contract,
      offset: 0}

    this.wrenchService.activeJobMsgList(this.contrData).subscribe(
        msgListTotalData => {
          this.msgListTotalData = msgListTotalData;
          // console.log("REFER  RETURN->", this.referTotalData);
          this.msgListData = this.msgListTotalData.result_list;
          console.log("REFER RETURN DATA->", this.msgListData);
        }
    );

  }

  jobInterest(item){

  }
}
