Description
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
https://localhost/admin#/greetings/%2Fgreetings%2F1/show
or
https://localhost/admin/greetings/%2Fgreetings%2F1/show
but could be:
https://localhost/admin/greetings/1/show
Example
// 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.
Description
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
or
but could be:
Example
Rough idea and not great naming, but something like that would be nice.