From ec5a14d7d61d5f1797fcfba67dd2d8ef0cca2360 Mon Sep 17 00:00:00 2001 From: Adam Soltys Date: Wed, 7 Sep 2022 13:58:00 -0700 Subject: image uploads --- src/lib/upload.js | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) (limited to 'src/lib/upload.js') diff --git a/src/lib/upload.js b/src/lib/upload.js index e7a73fee..d43148fb 100644 --- a/src/lib/upload.js +++ b/src/lib/upload.js @@ -1,13 +1,11 @@ import { get } from 'svelte/store'; import { token } from '$lib/store'; -export const upload = async (file, progress) => { - let url = '/api/profile'; +export const upload = async (file, type, progress) => { + let url = `/api/upload/${type}`; let formData = new FormData(); formData.append('file', file); - console.log('uploading', file); - return new Promise((resolve, reject) => { let ajax = new XMLHttpRequest(); ajax.addEventListener('load', () => { -- cgit v1.2.3