Skip to content

Commit

Permalink
modify staging mads_raw url lookup correctly
Browse files Browse the repository at this point in the history
  • Loading branch information
thisismattmiller committed Oct 23, 2024
1 parent 2e05a03 commit d8c06e9
Showing 1 changed file with 14 additions and 1 deletion.
15 changes: 14 additions & 1 deletion src/lib/utils_network.js
Original file line number Diff line number Diff line change
Expand Up @@ -490,7 +490,7 @@ const utilsNetwork = {
*/
fetchContextData: async function(uri){
let returnUrls = useConfigStore().returnUrls

if ((uri.startsWith('http://id.loc.gov') || uri.startsWith('https://id.loc.gov')) && uri.match(/(authorities|vocabularies)/)) {
var jsonuri = uri + '.madsrdf_raw.jsonld';

Expand All @@ -514,9 +514,22 @@ const utilsNetwork = {
if (returnUrls.env == 'production'){
jsonuri = jsonuri.replace('http://id.', 'https://preprod-8080.id.')
jsonuri = jsonuri.replace('https://id.', 'https://preprod-8080.id.')
}

// rewrite the url to the config if we are using staging
if (returnUrls.env == 'staging' && !returnUrls.dev){
let stageUrlPrefix = returnUrls.id.split('loc.gov/')[0]


// console.log('stageUrlPrefix',stageUrlPrefix)

jsonuri = jsonuri.replace('http://id.', stageUrlPrefix)
jsonuri = jsonuri.replace('https://id.', stageUrlPrefix)
}
// console.log(jsonuri)
// console.log(returnUrls)



// unless we are in a dev or public mode

Expand Down

0 comments on commit d8c06e9

Please sign in to comment.