mesmsv.service.ts 941 B

123456789101112131415161718192021222324252627282930
  1. import { HttpClient, HttpHeaders } from '@angular/common/http';
  2. import { Injectable } from '@angular/core';
  3. import { MatSnackBar } from '@angular/material/snack-bar';
  4. import { ResponseData } from 'src/app/interfaces/response-data';
  5. import { USERInterface } from 'src/app/interfaces/user-interface';
  6. import { IAMService } from '../../iam/iam.service';
  7. @Injectable({
  8. providedIn: 'root'
  9. })
  10. export class MESMSVService {
  11. private _url = 'https://qasirh.ittec.mx/v1/public/api/MESMSV';
  12. jwt = localStorage.getItem('jwt');
  13. header = new HttpHeaders().set('Authorization', 'Bearer ' + this.jwt);
  14. constructor(
  15. private http: HttpClient,
  16. private _snackBar: MatSnackBar,
  17. ) { }
  18. crear(data: any) {
  19. return this.http.post<ResponseData>(`${this._url}/insertar`, data, { headers: this.header });
  20. }
  21. modificar(data: any) {
  22. return this.http.post<ResponseData>(`${this._url}/modificar`, data, { headers: this.header });
  23. }
  24. }