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

import { ApiService, CategoryRead } from '../../../openapi'

@Injectable()
export class CategoryResolver  {
    constructor(
        public apiService: ApiService,
        private router: Router
    ) {}

    resolve(route: ActivatedRouteSnapshot, state: RouterStateSnapshot): Observable<CategoryRead[]> {
        return this.apiService.getCategoriesApiCategoriesGet()
    }
}
