import {Injectable} from '@angular/core';
import {ResourceBase} from '../../../../core/api/resource';
import {HttpClient} from '@angular/common/http';
import {Observable} from 'rxjs';
import {catchError} from 'rxjs/operators';

@Injectable({
	providedIn: 'root'
})
export class VehiculosService extends ResourceBase {

	constructor(public http: HttpClient) {
		super(http, 'administrador/vehiculos');
	}

	public sucursales(url) : Observable<any> {
		return this.http.get(this.baseUrl+url).pipe(
			catchError(this.handleError('index'))
		);
	}

	public tiposVehiculos(url) : Observable<any> {
		return this.http.get(this.baseUrl+url).pipe(
			catchError(this.handleError('index'))
		);
	}
}
