Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

286
Views
Query param en Nestjs: quiero hacer un servicio que te permita filtrar los libros por categorías,

Estoy tratando de crear un servicio para poder filtrar los libros por categorías, no puedo obtener el parámetro de consulta para el servicio de libros.

controlador de libro

 @ApiTags('books') @Controller('book') export class BookController { constructor(private readonly getBook: GetBookApi) {} @Get() @ApiOperation({ description: 'Return Books from Api', }); async findAll(@Query() input:GetBookInputDto):Promise<BookDTO[]> { return await this.getBook.category(input.category); } }

Pero no puedo obtener el parámetro de consulta para el servicio de libros.

 // Book Service @Injectable() export class BookService { constructor(private readonly client: BookClient) {} async getCategorys(): Promise<Book[]> { const result = await this.client.get(); if (result && result.data && !result.data.error) { return BookAdapter.mapperBookResponse(result.data); } else { throw new UnauthorizedException('Error getting identifiers '); } } }

aqui tengo el libro de clientes donde tengo la url usando axios

 async get() { const host = 'http://www.etnassoft.com/api/v1/' const path = 'get?category=libros'; const newInstance = axios.create({ baseURL: host, timeout: 10000, headers: { Accept: 'application/json', }, }); const request: AxiosResponse = await newInstance({ method: 'get', url: path, }); return request; } }
about 4 years ago · Juan Pablo Isaza
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!