import { Injectable } from '@angular/core';
import { ActivatedRouteSnapshot, Resolve } from '@angular/router';
import { Definition } from '@xdf/gallery';
import { CalendarExceptionService } from '../services/calendar-exception.service';

@Injectable()
export class CalendarExceptionResolver implements Resolve<Definition> {
    constructor(protected service: CalendarExceptionService) {
    }

    resolve(route: ActivatedRouteSnapshot): any {
        const sortDirection = 'asc';
        const columnName = 'description';
        const filterExpresion = '';
        return this.service.getByCaleId(route.queryParams.id, sortDirection, columnName, filterExpresion);
    }

}