uploader fix
This commit is contained in:
@@ -13,8 +13,7 @@ export default () => {
|
||||
SMS_API_KEY: process.env.SMS_API_KEY ?? '',
|
||||
SMS_SENDER: process.env.SMS_SENDER ?? '',
|
||||
SMS_API_BASE_URL:
|
||||
process.env.SMS_API_BASE_URL ??
|
||||
'https://api.sms-webservice.com/api/V3',
|
||||
process.env.SMS_API_BASE_URL ?? 'https://api.sms-webservice.com/api/V3',
|
||||
OTP_LENGTH: process.env.OTP_LENGTH ?? '5',
|
||||
OTP_EXPIRES_IN_MINUTES: process.env.OTP_EXPIRES_IN_MINUTES ?? '5',
|
||||
OTP_SALON_SIGNUP_EXPIRES_IN_MINUTES:
|
||||
@@ -37,6 +36,8 @@ export default () => {
|
||||
S3_BUCKET: process.env.S3_BUCKET ?? 'c274938',
|
||||
S3_REGION: process.env.S3_REGION ?? 'us-east-1',
|
||||
S3_PUBLIC_BASE_URL:
|
||||
process.env.S3_PUBLIC_BASE_URL ?? process.env.S3_ENDPOINT ?? 'https://c274938.parspack.net',
|
||||
process.env.S3_PUBLIC_BASE_URL ??
|
||||
process.env.S3_ENDPOINT ??
|
||||
'https://c274938.parspack.net',
|
||||
};
|
||||
};
|
||||
|
||||
@@ -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