|
|
@@ -115,7 +115,12 @@ export class AdsController {
|
|
|
@Param() { id }: MongoIdParamDto,
|
|
|
@Req() req: FastifyRequest,
|
|
|
) {
|
|
|
- const mpFile = await (req as any).file();
|
|
|
+ const reqAny = req as any;
|
|
|
+ const bodyFile = reqAny.body?.file;
|
|
|
+ let mpFile = Array.isArray(bodyFile) ? bodyFile[0] : bodyFile;
|
|
|
+ if (!mpFile && reqAny.isMultipart?.()) {
|
|
|
+ mpFile = await reqAny.file();
|
|
|
+ }
|
|
|
|
|
|
if (!mpFile) {
|
|
|
throw new BadRequestException('No file uploaded');
|