#
This commit is contained in:
@@ -29,7 +29,7 @@ updateIsWatched();
|
||||
watchButton.onclick = async e => {
|
||||
e.preventDefault();
|
||||
|
||||
const [, , id] = window.location.pathname.split("/");
|
||||
const id = window.location.pathname.split("/")[2].replace("#", "");
|
||||
const resultObject = await postData("/toggleWatched", { id: id }, token);
|
||||
//alert(resultObject.message);
|
||||
updateIsWatched();
|
||||
@@ -43,14 +43,14 @@ showStatsButton.onclick = async e => {
|
||||
}
|
||||
|
||||
async function updateIsWatched() {
|
||||
const [, , id] = window.location.pathname.split("/");
|
||||
const id = window.location.pathname.split("/")[2].replace("#", "");
|
||||
const resultObject = await postData("/isWatched", {id: id}, token);
|
||||
const isWatched = resultObject.isWatched;
|
||||
watchButton.innerHTML = isWatched ? "Stop Watching Player" : "Watch Player";
|
||||
}
|
||||
|
||||
async function populatePlayerData() {
|
||||
const [, , id] = window.location.pathname.split("/");
|
||||
const id = window.location.pathname.split("/")[2].replace("#", "");
|
||||
let resultObject = await postData("/getPlayerStats", {
|
||||
playerID: id
|
||||
}, token);
|
||||
|
||||
Reference in New Issue
Block a user