Closed saroro1 closed 1 year ago
@TypedRoute.Delete('/photo') async deletePhotos( @Req() req: USER_TYPE, //extends Request @TypedQuery() params: ExcelPhotoDeleteBody, ): Promise<ExcelPhotoResInterface> { console.log(req.query.files); console.log(params.files); if (params.files.length === 0) { throw new BadRequestError(ErrorMsg.BAD_REQUEST); } return await this.excelService.deletePhotos(req.user, params.files); }
export interface ExcelPhotoDeleteBody { /** * 파일 목록 */ files: string[]; }
After sending request like files[]=asdf1&files[]=asdf2 req.query.files can accept string[] but TypedQuery() doesn't.
files[]=asdf1&files[]=asdf2
Could you make @TypeQuery accept array like query?
Declare like a=1&a=2&a=3.
a=1&a=2&a=3
The variable[] is not standard.
variable[]
After sending request like
files[]=asdf1&files[]=asdf2
req.query.files can accept string[] but TypedQuery() doesn't.Could you make @TypeQuery accept array like query?