Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

191
Vistas
better way to write code when multiple query parameters are present

I've a controller xyz.controller.ts

@Get()
fetch(
 @Query('id') id: number,
 @Query('status') status: string, 
 @Query('country_id') countryId: number,
 @Query('state_id') stateId: number): Promise<any> {
     return await this.xyzService(id, status, countryId, stateId);
}

Is there any way to pass the query params as a single object instead of creating multiple function args?

about 4 years ago · Juan Pablo Isaza
1 Respuestas
Responde la pregunta

0

if you specify the key in the query, it will only return the value of that key, but if you just write @Query() query it will return the whole query object and then you can create a interface to give a type to the query object, @Query() query: IQuery

about 4 years ago · Juan Pablo Isaza Denunciar
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda