Add logging for fetch operations in Webmentions component
All checks were successful
Deploy / deploy (push) Successful in 1m15s
All checks were successful
Deploy / deploy (push) Successful in 1m15s
This commit is contained in:
parent
42521444a8
commit
8003d501d4
1 changed files with 2 additions and 0 deletions
|
|
@ -48,6 +48,7 @@ async function fetchForTarget(target: string): Promise<WMEntry[]> {
|
||||||
console.warn('[webmentions] WEBMENTION_TOKEN is not set — skipping fetch.');
|
console.warn('[webmentions] WEBMENTION_TOKEN is not set — skipping fetch.');
|
||||||
return [];
|
return [];
|
||||||
}
|
}
|
||||||
|
console.log(`[webmentions] fetching ${target} (token length: ${token.length})`);
|
||||||
const url = new URL(API);
|
const url = new URL(API);
|
||||||
url.searchParams.set('target', target);
|
url.searchParams.set('target', target);
|
||||||
url.searchParams.set('token', token);
|
url.searchParams.set('token', token);
|
||||||
|
|
@ -58,6 +59,7 @@ async function fetchForTarget(target: string): Promise<WMEntry[]> {
|
||||||
return [];
|
return [];
|
||||||
}
|
}
|
||||||
const json = (await res.json()) as WMResponse;
|
const json = (await res.json()) as WMResponse;
|
||||||
|
console.log(`[webmentions] → ${json.children?.length ?? 0} mentions`);
|
||||||
return json.children ?? [];
|
return json.children ?? [];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue