add file upload to card create

This commit is contained in:
andres
2023-07-16 14:35:23 +02:00
parent cde1d9fd02
commit f2437db3b7
6 changed files with 107 additions and 20 deletions

View File

@@ -42,10 +42,8 @@ export class CardsController {
files: { questionImg: Express.Multer.File[]; answerImg: Express.Multer.File[] },
@Body() body: UpdateCardDto
) {
console.log({ body })
console.log(files)
return this.commandBus.execute(
new UpdateCardCommand(id, body, req.user.id, files.answerImg[0], files.questionImg[0])
new UpdateCardCommand(id, body, req.user.id, files.answerImg?.[0], files.questionImg?.[0])
)
}