uploader fix
This commit is contained in:
@@ -4,7 +4,9 @@ export class UploadFileResponseDto {
|
||||
@ApiProperty({ example: 'uploads/2026/07/uuid-photo.jpg' })
|
||||
key: string;
|
||||
|
||||
@ApiProperty({ example: 'https://c274938.parspack.net/uploads/2026/07/uuid-photo.jpg' })
|
||||
@ApiProperty({
|
||||
example: 'https://c274938.parspack.net/uploads/2026/07/uuid-photo.jpg',
|
||||
})
|
||||
url: string;
|
||||
|
||||
@ApiProperty({ example: 'photo.jpg' })
|
||||
|
||||
@@ -7,23 +7,18 @@ import {
|
||||
UseInterceptors,
|
||||
} from '@nestjs/common';
|
||||
import { FileInterceptor, FilesInterceptor } from '@nestjs/platform-express';
|
||||
import {
|
||||
ApiBearerAuth,
|
||||
ApiBody,
|
||||
ApiConsumes,
|
||||
ApiTags,
|
||||
} from '@nestjs/swagger';
|
||||
import { ApiBearerAuth, ApiBody, ApiConsumes, ApiTags } from '@nestjs/swagger';
|
||||
import { memoryStorage } from 'multer';
|
||||
import { AllowWithoutSubscription } from '../auth/decorators/allow-without-subscription.decorator';
|
||||
import { Roles } from '../auth/decorators/roles.decorator';
|
||||
import { RolesGuard } from '../auth/guards/roles.guard';
|
||||
import { PermissionsGuard } from '../auth/guards/permissions.guard';
|
||||
import { UserRole } from '../users/enums/user-role.enum';
|
||||
import { SWAGGER_JWT_AUTH } from '../swagger/swagger.setup';
|
||||
import { RolesGuard } from '../auth/guards/roles.guard';
|
||||
import {
|
||||
ApiStandardController,
|
||||
ApiStandardOkResponse,
|
||||
} from '../swagger/decorators/swagger-response.decorator';
|
||||
import { SWAGGER_JWT_AUTH } from '../swagger/swagger.setup';
|
||||
import { UserRole } from '../users/enums/user-role.enum';
|
||||
import {
|
||||
MultiUploadResponseDto,
|
||||
UploadFileResponseDto,
|
||||
|
||||
@@ -45,7 +45,9 @@ export class UploaderService {
|
||||
});
|
||||
}
|
||||
|
||||
async uploadSingle(file: Express.Multer.File): Promise<UploadFileResponseDto> {
|
||||
async uploadSingle(
|
||||
file: Express.Multer.File,
|
||||
): Promise<UploadFileResponseDto> {
|
||||
this.validateFile(file);
|
||||
return this.uploadFile(file);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user