Skip to content

Commit

Permalink
Remove unused functions
Browse files Browse the repository at this point in the history
  • Loading branch information
devleejb committed Nov 26, 2024
1 parent b15117f commit 867c4fe
Showing 1 changed file with 1 addition and 25 deletions.
26 changes: 1 addition & 25 deletions backend/src/files/files.service.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { GetObjectCommand, PutObjectCommand, S3Client, S3ClientConfig } from "@aws-sdk/client-s3";
import { GetObjectCommand, PutObjectCommand, S3Client } from "@aws-sdk/client-s3";
import { getSignedUrl } from "@aws-sdk/s3-request-presigner";
import {
BadRequestException,
Expand All @@ -14,7 +14,6 @@ import * as htmlPdf from "html-pdf-node";
import * as MarkdownIt from "markdown-it";
import { PrismaService } from "src/db/prisma.service";
import { generateRandomKey } from "src/utils/functions/random-string";
import { StorageType } from "src/utils/types/storage.type";
import { CreateUploadPresignedUrlResponse } from "./types/create-upload-url-response.type";
import { ExportFileRequestBody, ExportFileResponse } from "./types/export-file.type";

Expand Down Expand Up @@ -126,27 +125,4 @@ export class FilesService {
fileName: `${fileName}.pdf`,
};
}

private getStorageConfig = (): S3ClientConfig => {
const bucketType: StorageType = this.configService.get("BUCKET_TYPE") || "S3";
const region = this.configService.get("AWS_REGION") || "us-east-1";
if (bucketType === "MINIO") {
const endpoint = this.configService.get("MINIO_ENDPOINT");
const accessKeyId = this.configService.get("MINIO_ACCESS_KEY");
const secretAccessKey = this.configService.get("MINIO_SECRET_KEY");
return {
region,
endpoint,
forcePathStyle: true,
credentials: {
accessKeyId,
secretAccessKey,
},
};
}

return {
region,
};
};
}

0 comments on commit 867c4fe

Please sign in to comment.