fix more bugs v0.0.11
This commit is contained in:
parent
a99e82dd4a
commit
551f287b0a
@ -54,7 +54,7 @@ const registerUser = (name, username, email, password, verifyPassword) => {
|
|||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
const res = fetch(`${url}/user/create`, {
|
const res = fetch(`${url}/user/create/`, {
|
||||||
method: "POST",
|
method: "POST",
|
||||||
body: JSON.stringify({
|
body: JSON.stringify({
|
||||||
name: name,
|
name: name,
|
||||||
@ -74,7 +74,7 @@ const getUserToken = async () => {
|
|||||||
const form = document.getElementById("register-form");
|
const form = document.getElementById("register-form");
|
||||||
const formData = new FormData(form);
|
const formData = new FormData(form);
|
||||||
|
|
||||||
const res = fetch(`${url}/token`, {
|
const res = fetch(`${url}/token/`, {
|
||||||
method: "POST",
|
method: "POST",
|
||||||
body: formData,
|
body: formData,
|
||||||
});
|
});
|
||||||
|
@ -21,7 +21,7 @@ const setTooltip = (type, message) => {
|
|||||||
}
|
}
|
||||||
|
|
||||||
const signIn = async (username, password) => {
|
const signIn = async (username, password) => {
|
||||||
const res = fetch(`${url}/user/login`, {
|
const res = fetch(`${url}/user/login/`, {
|
||||||
method: "POST",
|
method: "POST",
|
||||||
body: JSON.stringify({
|
body: JSON.stringify({
|
||||||
username: username,
|
username: username,
|
||||||
@ -66,7 +66,7 @@ const getUserToken = async () => {
|
|||||||
const form = document.getElementById("sign-in-form");
|
const form = document.getElementById("sign-in-form");
|
||||||
const formData = new FormData(form);
|
const formData = new FormData(form);
|
||||||
|
|
||||||
const res = fetch(`${url}/token`, {
|
const res = fetch(`${url}/token/`, {
|
||||||
method: "POST",
|
method: "POST",
|
||||||
body: formData,
|
body: formData,
|
||||||
});
|
});
|
||||||
|
@ -73,7 +73,7 @@ const loadUserTasks = () => {
|
|||||||
}
|
}
|
||||||
|
|
||||||
const getUserTasks = (userToken) => {
|
const getUserTasks = (userToken) => {
|
||||||
const res = fetch(`${url}/users/me`, {
|
const res = fetch(`${url}/users/me/`, {
|
||||||
headers: {Authorization: `Bearer ${userToken}`}
|
headers: {Authorization: `Bearer ${userToken}`}
|
||||||
});
|
});
|
||||||
|
|
||||||
@ -110,7 +110,7 @@ const updateTask = (userToken, taskTitle, taskDescription, completedStatus) => {
|
|||||||
"is_completed": completedStatus
|
"is_completed": completedStatus
|
||||||
});
|
});
|
||||||
|
|
||||||
const res = fetch(`${localhostUrl}/user/update-tasks`, {
|
const res = fetch(`${localhostUrl}/user/update-tasks/`, {
|
||||||
method: "PATCH",
|
method: "PATCH",
|
||||||
headers: {Authorization: `Bearer ${userToken}`, "Content-type": "application/json"},
|
headers: {Authorization: `Bearer ${userToken}`, "Content-type": "application/json"},
|
||||||
body: body
|
body: body
|
||||||
@ -119,4 +119,4 @@ const updateTask = (userToken, taskTitle, taskDescription, completedStatus) => {
|
|||||||
return res;
|
return res;
|
||||||
}
|
}
|
||||||
|
|
||||||
loadUserTasks(token);
|
loadUserTasks();
|
@ -26,11 +26,11 @@
|
|||||||
<label for="name" class="register-label-name">Name</label>
|
<label for="name" class="register-label-name">Name</label>
|
||||||
<input id="name" type="text" class="register-name-input" placeholder="John Doe" />
|
<input id="name" type="text" class="register-name-input" placeholder="John Doe" />
|
||||||
<label for="username" class="register-label-username">Username</label>
|
<label for="username" class="register-label-username">Username</label>
|
||||||
<input id="username" type="text" class="register-username-input" placeholder="johndoe23" />
|
<input name='usernmae' id="username" type="text" class="register-username-input" placeholder="johndoe23" />
|
||||||
<label for="email" class="register-label-email">Email</label>
|
<label for="email" class="register-label-email">Email</label>
|
||||||
<input id="email" type="text" class="register-email-input" placeholder="johndoe23@gmail.com" />
|
<input id="email" type="text" class="register-email-input" placeholder="johndoe23@gmail.com" />
|
||||||
<label for="password" class="register-label-password">Password</label>
|
<label for="password" class="register-label-password">Password</label>
|
||||||
<input id="password" type="password" class="register-password-input" />
|
<input name='password' id="password" type="password" class="register-password-input" />
|
||||||
<label for="verify-password" class="register-label-password">Verify Password</label>
|
<label for="verify-password" class="register-label-password">Verify Password</label>
|
||||||
<input id="verify-password" type="password" class="register-verify-password-input" />
|
<input id="verify-password" type="password" class="register-verify-password-input" />
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user