import { Controller , Get , Param } from '@nestjs/common' ; import { CategoriesService } from '../../../service' ; @ Controller ( 'categories' ) export class CategoriesController { constructor ( private readonly categoriesService ) { } @ Get ( ) root ( ) { return this . categoriesService . getTermsByTaxonomy ( 'category' ) ; } @ Get ( ':taxonomy/:slug' ) findByTaxonomySlug ( @ Param ( 'slug' ) slug , @ Param ( 'taxonomy' ) taxonomy ) { return this . categoriesService . findTermBySlug ( taxonomy , slug ) ; } }