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;
|
||||
}
|
||||
|
||||
const res = fetch(`${url}/user/create`, {
|
||||
const res = fetch(`${url}/user/create/`, {
|
||||
method: "POST",
|
||||
body: JSON.stringify({
|
||||
name: name,
|
||||
@ -74,7 +74,7 @@ const getUserToken = async () => {
|
||||
const form = document.getElementById("register-form");
|
||||
const formData = new FormData(form);
|
||||
|
||||
const res = fetch(`${url}/token`, {
|
||||
const res = fetch(`${url}/token/`, {
|
||||
method: "POST",
|
||||
body: formData,
|
||||
});
|
||||
|
@ -21,7 +21,7 @@ const setTooltip = (type, message) => {
|
||||
}
|
||||
|
||||
const signIn = async (username, password) => {
|
||||
const res = fetch(`${url}/user/login`, {
|
||||
const res = fetch(`${url}/user/login/`, {
|
||||
method: "POST",
|
||||
body: JSON.stringify({
|
||||
username: username,
|
||||
@ -66,7 +66,7 @@ const getUserToken = async () => {
|
||||
const form = document.getElementById("sign-in-form");
|
||||
const formData = new FormData(form);
|
||||
|
||||
const res = fetch(`${url}/token`, {
|
||||
const res = fetch(`${url}/token/`, {
|
||||
method: "POST",
|
||||
body: formData,
|
||||
});
|
||||
|
@ -73,7 +73,7 @@ const loadUserTasks = () => {
|
||||
}
|
||||
|
||||
const getUserTasks = (userToken) => {
|
||||
const res = fetch(`${url}/users/me`, {
|
||||
const res = fetch(`${url}/users/me/`, {
|
||||
headers: {Authorization: `Bearer ${userToken}`}
|
||||
});
|
||||
|
||||
@ -110,7 +110,7 @@ const updateTask = (userToken, taskTitle, taskDescription, completedStatus) => {
|
||||
"is_completed": completedStatus
|
||||
});
|
||||
|
||||
const res = fetch(`${localhostUrl}/user/update-tasks`, {
|
||||
const res = fetch(`${localhostUrl}/user/update-tasks/`, {
|
||||
method: "PATCH",
|
||||
headers: {Authorization: `Bearer ${userToken}`, "Content-type": "application/json"},
|
||||
body: body
|
||||
@ -119,4 +119,4 @@ const updateTask = (userToken, taskTitle, taskDescription, completedStatus) => {
|
||||
return res;
|
||||
}
|
||||
|
||||
loadUserTasks(token);
|
||||
loadUserTasks();
|
@ -26,11 +26,11 @@
|
||||
<label for="name" class="register-label-name">Name</label>
|
||||
<input id="name" type="text" class="register-name-input" placeholder="John Doe" />
|
||||
<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>
|
||||
<input id="email" type="text" class="register-email-input" placeholder="johndoe23@gmail.com" />
|
||||
<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>
|
||||
<input id="verify-password" type="password" class="register-verify-password-input" />
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user