view specific posts
This commit is contained in:
11
client/e404.html
Normal file
11
client/e404.html
Normal file
@@ -0,0 +1,11 @@
|
||||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<title>404</title>
|
||||
<link rel="stylesheet" type="text/css" href="/style.css">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||
</head>
|
||||
<body>
|
||||
<h1>404 lmao</h1>
|
||||
</body>
|
||||
</html>
|
||||
@@ -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");
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user