24 lines
712 B
TypeScript
24 lines
712 B
TypeScript
import { Injectable } from '@angular/core';
|
|
import { Observable } from 'rxjs';
|
|
import { map } from 'rxjs/operators';
|
|
|
|
import { ApiService } from './api.service';
|
|
import { AeronefByImat, AeronefByYear } from 'src/app/core/models';
|
|
|
|
@Injectable({ providedIn: 'root' })
|
|
export class AeronefsService {
|
|
constructor(
|
|
private apiService: ApiService
|
|
) { }
|
|
|
|
getAllByImat(): Observable<Array<AeronefByImat>> {
|
|
return this.apiService.get('/aeronefs/allByImat')
|
|
.pipe(map(data => data.aeronefs));
|
|
}
|
|
|
|
getAllByImatByYear(): Observable<Array<AeronefByYear>> {
|
|
return this.apiService.get('/aeronefs/allByImatByYear')
|
|
.pipe(map(data => data.aeronefs));
|
|
}
|
|
|
|
} |