mirror of
https://github.com/rikkaneko/paste.git
synced 2025-06-08 00:23:31 +00:00
Fix typo
Signed-off-by: Joe Ma <rikkaneko23@gmail.com>
This commit is contained in:
parent
bb521d62eb
commit
2d2cb5e804
1 changed files with 11 additions and 2 deletions
|
@ -286,7 +286,7 @@ $(function () {
|
||||||
});
|
});
|
||||||
|
|
||||||
if (!res1.ok) {
|
if (!res1.ok) {
|
||||||
throw new Error(`Unable to upload paste: ${(await res1.text()) || `${res.status} ${res.statusText}`}`);
|
throw new Error(`Unable to upload paste: ${(await res1.text()) || `${res1.status} ${res1.statusText}`}`);
|
||||||
}
|
}
|
||||||
// Finialize the paste
|
// Finialize the paste
|
||||||
const res2 = await fetch(`${ENDPOINT}/v2/large_upload/complete/${create_result.uuid}`, {
|
const res2 = await fetch(`${ENDPOINT}/v2/large_upload/complete/${create_result.uuid}`, {
|
||||||
|
@ -298,7 +298,7 @@ $(function () {
|
||||||
show_pop_alert(`Paste #${complete_result.paste_info.uuid} created!`, 'alert-success');
|
show_pop_alert(`Paste #${complete_result.paste_info.uuid} created!`, 'alert-success');
|
||||||
pass_input.val('');
|
pass_input.val('');
|
||||||
} else {
|
} else {
|
||||||
throw new Error(`Unable to finialize paste: ${(await res2.text()) || `${res.status} ${res.statusText}`}`);
|
throw new Error(`Unable to finialize paste: ${(await res2.text()) || `${res2.status} ${res2.statusText}`}`);
|
||||||
}
|
}
|
||||||
} catch (err) {
|
} catch (err) {
|
||||||
console.log('error', err);
|
console.log('error', err);
|
||||||
|
@ -306,6 +306,15 @@ $(function () {
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
// Handle normal paste (<= 25MB)
|
// Handle normal paste (<= 25MB)
|
||||||
|
switch (type) {
|
||||||
|
case 'file':
|
||||||
|
case 'text':
|
||||||
|
formdata.set('paste-type', 'paste');
|
||||||
|
break;
|
||||||
|
case 'url':
|
||||||
|
formdata.set('paste-type', 'link');
|
||||||
|
}
|
||||||
|
|
||||||
// Remove empty entries
|
// Remove empty entries
|
||||||
let filtered = new FormData();
|
let filtered = new FormData();
|
||||||
formdata.forEach((val, key) => {
|
formdata.forEach((val, key) => {
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue