Skip to content

Commit

Permalink
fix: tsc compilation issues
Browse files Browse the repository at this point in the history
  • Loading branch information
DafyddLlyr committed Nov 14, 2023
1 parent 01a381f commit 67286e6
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 3 deletions.
3 changes: 1 addition & 2 deletions api.planx.uk/modules/file/controller.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ import { getFileFromS3 } from "./service/getFile";
import { z } from "zod";
import { ValidatedRequestHandler } from "../../shared/middleware/validate";
import { ServerError } from "../../errors";
import { S3 } from "aws-sdk";

assert(process.env.AWS_S3_BUCKET);
assert(process.env.AWS_S3_REGION);
Expand Down Expand Up @@ -73,7 +72,7 @@ export const downloadFileSchema = z.object({

export type DownloadController = ValidatedRequestHandler<
typeof downloadFileSchema,
S3.Body | undefined
Buffer | undefined
>;

export const publicDownloadController: DownloadController = async (
Expand Down
2 changes: 1 addition & 1 deletion api.planx.uk/modules/file/service/getFile.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ export const getFileFromS3 = async (fileId: string) => {
const file = await s3.getObject(params).promise();

return {
body: file.Body,
body: file.Body as Buffer,
isPrivate: file.Metadata?.is_private === "true",
headers: {
"Content-Type": file.ContentType,
Expand Down

0 comments on commit 67286e6

Please sign in to comment.