From 13466248004327e9a026cb89f94926f9b060d1c1 Mon Sep 17 00:00:00 2001 From: Adam Soltys Date: Wed, 11 Feb 2026 17:51:24 -0800 Subject: linting --- src/lib/upload.ts | 30 +++++++++++++++--------------- 1 file changed, 15 insertions(+), 15 deletions(-) (limited to 'src/lib/upload.ts') diff --git a/src/lib/upload.ts b/src/lib/upload.ts index 6d9d4230..aaeec007 100644 --- a/src/lib/upload.ts +++ b/src/lib/upload.ts @@ -1,18 +1,18 @@ export const upload = async (file, type, progress) => { - const url = `/api/upload/${type}`; - const formData = new FormData(); - formData.append("file", file); + const url = `/api/upload/${type}`; + const formData = new FormData(); + formData.append("file", file); - return new Promise((resolve, reject) => { - const ajax = new XMLHttpRequest(); - ajax.addEventListener("load", () => { - if (ajax.readyState === ajax.DONE) { - if (ajax.status === 200) resolve(ajax.response); - else reject(new Error(`Upload failed: ${ajax.response}`)); - } - }); - ajax.upload.addEventListener("progress", progress, false); - ajax.open("POST", url); - ajax.send(formData); - }); + return new Promise((resolve, reject) => { + const ajax = new XMLHttpRequest(); + ajax.addEventListener("load", () => { + if (ajax.readyState === ajax.DONE) { + if (ajax.status === 200) resolve(ajax.response); + else reject(new Error(`Upload failed: ${ajax.response}`)); + } + }); + ajax.upload.addEventListener("progress", progress, false); + ajax.open("POST", url); + ajax.send(formData); + }); }; -- cgit v1.2.3