import { HttpClient } from '@angular/common/http';
import { Injectable } from '@angular/core';
import { Observable } from 'rxjs';
import { TypeEq } from '../models/typeeq.model';

@Injectable({ providedIn: 'root' })
export class TypeEqService {
    // addType(modelType: Function) {
    //   throw new Error('Method not implemented.');
    // }

    constructor(private http: HttpClient) { }
    url: string = "http://b872-2405-9800-bc03-3665-282a-83c6-a83e-fc1b.ngrok.io";
    listType: TypeEq[] = []

    addTypeEq(model: TypeEq) {
        console.log("type", model)
    this.http.post(this.url + "/typeeq/", model).subscribe(response => {
      console.log(response);

    })
    }

    getListTypeEq(): Observable<TypeEq[]> {
        return this.http.get<TypeEq[]>(this.url + "/typeeq/lists");
    }
    
}
