mirror of
https://github.com/JustKato/FreePad.git
synced 2026-02-24 00:00:46 +02:00
Bunch more updates
This commit is contained in:
24
dist/static/js/main.js
vendored
24
dist/static/js/main.js
vendored
@@ -80,3 +80,27 @@ function goToPost() {
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
function getQr(link = `https://justkato.me/`) {
|
||||
return new Promise((_r, _e) => {
|
||||
let formData = new FormData();
|
||||
formData.append('link', link);
|
||||
|
||||
// Send out a fetch request
|
||||
fetch("/api/qr", {
|
||||
method: "post",
|
||||
body: formData,
|
||||
})
|
||||
.then( result => {
|
||||
result.json()
|
||||
.then( rez => {
|
||||
return _r(rez);
|
||||
})
|
||||
})
|
||||
.catch( error => {
|
||||
console.error(error);
|
||||
alert(error);
|
||||
return _e(error);
|
||||
})
|
||||
})
|
||||
}
|
||||
Reference in New Issue
Block a user