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

import { AdminBasket, AdminService } from '../../openapi'

@Injectable()
export class BasketResolver  {
    constructor(
        private router: Router,
        private adminService: AdminService,
    ) {}

    resolve(route: ActivatedRouteSnapshot, state: RouterStateSnapshot): Observable<AdminBasket> {
        var name = route.paramMap.get('name')
        return this.adminService.getBasketApiAdminBasketNameGet({name: name})
    }
}
