Skip to content

Commit

Permalink
Merge pull request #2177 from Inist-CNRS/2173-14062-le-format-lodex-f…
Browse files Browse the repository at this point in the history
…ield-ne-fonctionne-pas-lorsque-la-ressource-à-récupérer-provient-dune-instance-en-version-12-ex-référentiels-istex-en-v12233

fix lodex field for lodex@14 with lodex@12
  • Loading branch information
touv authored Oct 4, 2024
2 parents 8c057cc + 011d6e2 commit a35baea
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/app/js/formats/lodex/field/LodexFieldView.js
Original file line number Diff line number Diff line change
Expand Up @@ -226,19 +226,22 @@ export default compose(
if (source.pathname.search(/(ark|uid):/) >= 0) {
const [check, tenant = 'default', scheme, identifier] = source.pathname.split('/').filter(Boolean);
let uri;
let pathname;
if (check === 'instance') {
// Lodex >= 14
uri = `${scheme}/${identifier}`;
pathname = '/api/export/format/jsonallvalue';
} else {
// lodex <= 12
uri = source.pathname.slice(1);
pathname = '/api/export/jsonallvalue';
}
const target = {
protocol: source.protocol,
hostname: source.hostname,
slashes: source.slashes,
port: source.port,
pathname: '/api/export/format/jsonallvalue',
pathname,
search: `?uri=${uri}&tenant=${tenant}`,
};
const newValue = URL.format(target);
Expand Down

0 comments on commit a35baea

Please sign in to comment.