Added file uploads
This commit is contained in:
parent
911d17637f
commit
b2ce13eea1
10 changed files with 169 additions and 40 deletions
|
@ -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);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue