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

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

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

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

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

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

}
