import { Injectable } from '@angular/core'
import { RouterStateSnapshot, ActivatedRouteSnapshot } from '@angular/router'
import { Observable } from 'rxjs'

// import { DashboardDataService } from '../../_services/apollo.service'
import { DashboardService, Dashboard } from '../../openapi'

@Injectable()
export class DashboardPageResolver  {
    constructor(
        private dashboardService: DashboardService,
    ) {}

    resolve(route: ActivatedRouteSnapshot, state: RouterStateSnapshot): Observable<Dashboard> {
        return this.dashboardService.getDashboardPageApiDashboardPageGroupNameGet({
            group: route.paramMap.get('group'),
            name: route.paramMap.get('name')
        })
    }
}
