mirror of
https://github.com/ershisan99/flashcards-api.git
synced 2025-12-17 12:33:22 +00:00
add file upload to card create
This commit is contained in:
@@ -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])
|
||||
)
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user