Skip to content

Commit 63aa0c6

Browse files
committed
chore: add debug out to apiFetch
ref: #18
1 parent 28983c2 commit 63aa0c6

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

src/hooks/apiFetch.js

+8
Original file line numberDiff line numberDiff line change
@@ -18,10 +18,16 @@ export async function apiFetch(
1818
metadata = true,
1919
) {
2020

21+
console.debug(`apiFetch, using API_URL env variable:, ${window.env.API_URL}`)
22+
2123
if( String(url_path).includes(window.env.API_URL) ) { // normalise passed URLs
2224

25+
console.debug(`url_path for function apiFetch was a full url, ${url_path}, normalizing...`)
26+
2327
url_path = String(url_path).replace(window.env.API_URL, '')
2428

29+
console.debug(`normailized to ${url_path}`)
30+
2531
}
2632

2733
if( url_path ) {
@@ -43,6 +49,8 @@ export async function apiFetch(
4349

4450
url_path = String(url_path).replace('/add', '').replace('/delete', '').replace('/edit', '')
4551

52+
console.debug(`apiFetch url_path is: ${url_path}`)
53+
4654

4755
let request_data = {
4856
credentials: 'include',

0 commit comments

Comments
 (0)