1
0
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:
2022-05-18 01:36:18 +03:00
parent 1024c4abee
commit e6cc8a4bce
9 changed files with 90 additions and 12 deletions

View File

@@ -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);
})
})
}