Nightly: Revert Drag & Drop Upload (server endpoint + header handlers removed)
This commit is contained in:
parent
9e7b572feb
commit
6f51c493ed
3 changed files with 5 additions and 58 deletions
|
|
@ -184,21 +184,7 @@ export async function playUrl(url: string, guildId: string, channelId: string, v
|
|||
}
|
||||
}
|
||||
|
||||
export async function uploadFile(file: File, folder?: string) {
|
||||
const form = new FormData();
|
||||
form.append('file', file);
|
||||
if (folder) form.append('folder', folder);
|
||||
const res = await fetch(`${API_BASE}/upload`, {
|
||||
method: 'POST',
|
||||
credentials: 'include',
|
||||
body: form
|
||||
});
|
||||
if (!res.ok) {
|
||||
const data = await res.json().catch(()=>({}));
|
||||
throw new Error(data?.error || 'Upload failed');
|
||||
}
|
||||
return res.json();
|
||||
}
|
||||
// uploadFile removed (build reverted)
|
||||
|
||||
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue