import { Injectable } from '@angular/core';
import { HttpClient } from '@angular/common/http';
import { Observable } from 'rxjs';
import { DynaDataService } from '@xdf/gallery';

@Injectable({providedIn: 'root'})
export class FlightService extends DynaDataService {
    constructor(private httpClient: HttpClient) {
        super(httpClient);
    }

    edit(data: any, id: any): Observable<object> {
        this.serviceURL = '/service/flights/edit';
        return super.update(id, data);
    }

    create(data: any): Observable<object> {
        this.serviceURL = '/service/flights/create';
        return super.create(data);
    }

    getResultList(serviceURL?: string) {
        this.serviceURL = '/service/flights';
        return super.getResultList(serviceURL);
    }

    getResult(id: any): Observable<object> {
        this.serviceURL = '/service/flights';
        return super.getResult(id);
    }
}
