view specific posts

This commit is contained in:
2026-07-20 20:11:06 +10:00
parent 94b5365a1c
commit eff5313f26
5 changed files with 52 additions and 6 deletions

View File

@@ -1,5 +1,4 @@
function like(id) {
async function like(id) {
const usernameBox = document.getElementById('username');
const passwordBox = document.getElementById('password');
@@ -8,8 +7,12 @@ function like(id) {
formData.append('password', passwordBox.value);
formData.append('post', id);
fetch('/like', {
method: 'POST',
body: formData
const result = await fetch('/like', {
method: 'POST',
body: formData
});
if (result.status < 200 || result.status >= 400) {
alert("your post didnt get the like because the server thought your opinion was invalid");
}
}