summary refs log tree commit diff
path: root/src/util/util/cdn.ts
diff options
context:
space:
mode:
authorMadeline <46743919+MaddyUnderStars@users.noreply.github.com>2023-01-20 18:10:47 +1100
committerGitHub <noreply@github.com>2023-01-20 18:10:47 +1100
commit084dc0be08555891cad4c2bb984822a62ec5ec9f (patch)
treeed2ca0fafefa2224ae32761f955f63935422a97d /src/util/util/cdn.ts
parentfix: route file regex (#956) (diff)
downloadserver-084dc0be08555891cad4c2bb984822a62ec5ec9f.tar.xz
Add ESLint (#941)
* Add eslint, switch to lint-staged for precommit

* Fix all ESLint errors

* Update GH workflow to check prettier and eslint
Diffstat (limited to '')
-rw-r--r--src/util/util/cdn.ts4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/util/util/cdn.ts b/src/util/util/cdn.ts

index 6d2fd0f1..7f447c53 100644 --- a/src/util/util/cdn.ts +++ b/src/util/util/cdn.ts
@@ -24,7 +24,8 @@ import { Config } from "./Config"; export async function uploadFile( path: string, - file?: Express.Multer.File, + // These are the only props we use, don't need to enforce the full type. + file?: Pick<Express.Multer.File, "mimetype" | "originalname" | "buffer">, ): Promise<Attachment> { if (!file?.buffer) throw new HTTPError("Missing file in body"); @@ -60,7 +61,6 @@ export async function handleFile( const mimetype = body.split(":")[1].split(";")[0]; const buffer = Buffer.from(body.split(",")[1], "base64"); - // @ts-ignore const { id } = await uploadFile(path, { buffer, mimetype,