From 5314092dacbfce9a9f4a56f2c25a1d942123b27b Mon Sep 17 00:00:00 2001 From: Hidayatullah Wildan Ghaly Buchary <16521502@std.stei.itb.ac.id> Date: Sun, 8 Oct 2023 16:56:22 +0700 Subject: [PATCH] fix: login-register href fix: hof double include --- api/search/search.php | 4 ++-- public/js/Hall-of-Fame.js | 3 ++- public/js/login.js | 2 +- public/js/register.js | 2 +- 4 files changed, 6 insertions(+), 5 deletions(-) diff --git a/api/search/search.php b/api/search/search.php index 20543fe..d0c3bbf 100644 --- a/api/search/search.php +++ b/api/search/search.php @@ -2,10 +2,10 @@ session_start(); -include "../../config/config.php"; +// include "../../config/config.php"; include "../../app/models/user.php"; -ini_set('display_errors', 1); +// ini_set('display_errors', 1); $users = new UserModel(); $params = array(); diff --git a/public/js/Hall-of-Fame.js b/public/js/Hall-of-Fame.js index 5b10e6d..5740e2f 100644 --- a/public/js/Hall-of-Fame.js +++ b/public/js/Hall-of-Fame.js @@ -235,8 +235,9 @@ function searchUser(filter, sort, input, isAdmin) { xhr.onload = function () { if (xhr.status === 200) { + console.log(this.responseText); let response = JSON.parse(this.responseText); - // console.log(this.responseText); + // displayData(response, (parseInt(page) - 1) * 10, isAdmin); diff --git a/public/js/login.js b/public/js/login.js index fa55e41..8c75c28 100644 --- a/public/js/login.js +++ b/public/js/login.js @@ -22,7 +22,7 @@ document.addEventListener("DOMContentLoaded", function() { console.log(response); console.log(response.length) if (response === "success") { - window.location.href = "../challenge"; + window.location.href = "../challenge/"; } else if (response === "error") { alert("Invalid username or password"); } else { diff --git a/public/js/register.js b/public/js/register.js index ad323d7..b9786ae 100644 --- a/public/js/register.js +++ b/public/js/register.js @@ -130,7 +130,7 @@ function registerUser(username, email, password) { console.log(response); if (response == "success") { - window.location.href = '../challenge'; + window.location.href = '../challenge/'; } else { alert('Gagal mendaftar akun baru'); } -- GitLab