You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Allow custom marshalling / unmarshalling of IRIs for admin URLs #659
Currently the client URLs get constructed from full IRIs which works, but it's kind of ugly.
It would be nice if the Hydra data provider allowed the user to marshall / unmarshall the IRI into a "nice" ID for the routing. It would mean the admin URL is not
// What the PR would add to the factory options:
dataProviderFactory({
entrypoint: '/api',
mercure: false,
// New: transform @id before it becomes record.id
normalizeId: (iri: string) => iri.split('/').pop(),
// New: reconstruct fetch URL from the normalized id
resolveItemUrl: (resource, id, entrypointUrl) =>
new URL(`${entrypointUrl}/${resource}/${id}`),
})
Rough idea and not great naming, but something like that would be nice.
Activity