import { HttpClient, HttpHeaders } from '@angular/common/http';
import { Injectable } from '@angular/core';
import { MatSnackBar } from '@angular/material/snack-bar';
import { ResponseData } from 'src/app/interfaces/response-data';
import { USERInterface } from 'src/app/interfaces/user-interface';
import { IAMService } from '../../iam/iam.service';

@Injectable({
  providedIn: 'root'
})
export class MESMSVService {

  private _url = 'https://qasirh.ittec.mx/v1/public/api/MESMSV';
  usuario_session:USERInterface = JSON.parse(localStorage.getItem('usuario')!); 
  jwt = localStorage.getItem('jwt');
  header = new HttpHeaders().set('Authorization', 'Bearer ' + this.jwt);

  constructor(
    private http: HttpClient,
    private _snackBar: MatSnackBar,
  ) { }

  crear(data: any) {
    return this.http.post<ResponseData>(`${this._url}/insertar`, data, { headers: this.header });
  }

}
