Skip to content

Commit 67a9352

Browse files
committed
Use window.location to fetch data
1 parent f1f3b96 commit 67a9352

File tree

1 file changed

+7
-7
lines changed

1 file changed

+7
-7
lines changed

src/html/js/App.js

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -103,7 +103,7 @@ function addRequests(requests) {
103103
function fetchBlacklist() {
104104
const container = document.querySelector("#blacklist-count")
105105
const table = document.querySelector("#blacklist")
106-
fetch("http://localhost:8888/api/blacklist")
106+
fetch(window.location + "api/blacklist")
107107
.then(response => response.json())
108108
.then(data => {
109109
if (!isEmpty(data.blacklist)) {
@@ -118,7 +118,7 @@ function fetchBlacklist() {
118118
function fetchWhitelist() {
119119
const container = document.querySelector("#whitelist-count")
120120
const table = document.querySelector("#whitelist")
121-
fetch("http://localhost:8888/api/whitelist")
121+
fetch(window.location + "api/whitelist")
122122
.then(response => response.json())
123123
.then(data => {
124124
if (!isEmpty(data.whitelist)) {
@@ -133,7 +133,7 @@ function fetchWhitelist() {
133133
function fetchMarklist() {
134134
const container = document.querySelector("#marklist-count")
135135
const table = document.querySelector("#marklist")
136-
fetch("http://localhost:8888/api/marklist")
136+
fetch(window.location + "api/marklist")
137137
.then(response => response.json())
138138
.then(data => {
139139
if (!isEmpty(data.marklist)) {
@@ -147,7 +147,7 @@ function fetchMarklist() {
147147

148148
function fetchBlacklistWithReason() {
149149
const table = document.querySelector("#blacklist")
150-
fetch("http://localhost:8888/api/blacklist_with_reason")
150+
fetch(window.location + "api/blacklist_with_reason")
151151
.then(response => response.json())
152152
.then(data => {
153153
insertActorsWithReason(table, data.blacklist)
@@ -156,7 +156,7 @@ function fetchBlacklistWithReason() {
156156

157157
function fetchWhitelistWithReason() {
158158
const table = document.querySelector("#whitelist")
159-
fetch("http://localhost:8888/api/whitelist_with_reason")
159+
fetch(window.location + "api/whitelist_with_reason")
160160
.then(response => response.json())
161161
.then(data => {
162162
insertActorsWithReason(table, data.whitelist)
@@ -165,7 +165,7 @@ function fetchWhitelistWithReason() {
165165

166166
function fetchMarklistWithReason() {
167167
const table = document.querySelector("#marklist")
168-
fetch("http://localhost:8888/api/marklist_with_reason")
168+
fetch(window.location + "api/marklist_with_reason")
169169
.then(response => response.json())
170170
.then(data => {
171171
insertActorsWithReason(table, data.marklist)
@@ -174,7 +174,7 @@ function fetchMarklistWithReason() {
174174

175175
function fetchActorStatus() {
176176
const address = getAddress()
177-
fetch("http://localhost:8888/api/actor?address=" + address)
177+
fetch(window.location + "api/actor?address=" + address)
178178
.then(response => response.json())
179179
.then(data => {
180180
if (!isEmpty(data.status)) {

0 commit comments

Comments
 (0)