Added file uploads

This commit is contained in:
Xodrium 2023-02-07 19:36:32 -05:00
parent 911d17637f
commit b2ce13eea1
10 changed files with 169 additions and 40 deletions

View file

@ -7,13 +7,7 @@ export async function load({ fetch, params, url }) {
await new Promise(resolve => setTimeout(resolve, 100));
var f = (new FormData());
f.append('id',id);
const res = await fetch(`/api/postGet`, {
method: 'POST',
body: f
});
const res = await fetch(`/api/postGet?id=${id}`);
const postJson = (await res.json()).data;
console.log(postJson);