🐛 Fix IRI in pod response
Tim Izzo tim@5ika.ch
Mon, 06 Jan 2025 18:12:40 +0100
1 files changed,
5 insertions(+),
4 deletions(-)
jump to
M
src/lib/solid.ts
→
src/lib/solid.ts
@@ -1,14 +1,15 @@
import { getSolidDataset, getStringNoLocale, getThingAll, getUrl } from '@inrupt/solid-client'; import { FOAF, VCARD } from '@inrupt/vocab-common-rdf'; -export const fetchPod: typeof fetch = async (resource: URL | RequestInfo) => - fetch(`/solid/fetch?resource=${encodeURIComponent(resource.toString())}`); +export const fetchPod: typeof fetch = async (resource: URL | RequestInfo) => { + const response = await fetch(`/solid/fetch?resource=${encodeURIComponent(resource.toString())}`); + Object.defineProperty(response, 'url', { value: decodeURIComponent(resource.toString()) }); + return response; +}; export const getProfile = async (webId: string) => { const dataset = await getSolidDataset(webId, { fetch: fetchPod }); const subjects = getThingAll(dataset); - - console.log({ webId, subjects }); const findValue = (predicate: string) => subjects