import { Injectable } from '@angular/core';
import { HttpParams } from '@angular/common/http';
import { Observable } from 'rxjs';
import { map } from 'rxjs/operators';

import { ApiService } from './api.service';
import { DropZone, DropZoneByOaci, DropZoneByYear, JumpListConfig, JumpListFilters } from 'src/app/core/models';

@Injectable({ providedIn: 'root' })
export class DropZonesService {
    constructor(
        private apiService: ApiService
    ) { }

    getAllByOaci(): Observable<Array<DropZoneByOaci>> {
        return this.apiService.get('/dropzones')
            .pipe(map(data => data.dropzones));
    }

    getAllByDate(): Observable<Array<DropZoneByYear>> {
        return this.apiService.get('/dropzones/allByDate')
            .pipe(map(data => data.dropzones));
    }

}