Skip to content

Commit 0ae50f0

Browse files
authored
Merge pull request #246 from lcnetdev/use-8080-search-complex
Use 8080 For non-Production searches
2 parents e6010f8 + 14390b2 commit 0ae50f0

File tree

2 files changed

+8
-2
lines changed

2 files changed

+8
-2
lines changed

src/lib/utils_network.js

+7-1
Original file line numberDiff line numberDiff line change
@@ -432,6 +432,8 @@ const utilsNetwork = {
432432
url = url.replace('https://test-8080.id.lctl.gov','https://id.loc.gov')
433433
url = url.replace('https://preprod-8080.id.loc.gov','https://id.loc.gov')
434434
url = url.replace('https://preprod-8288.id.loc.gov','https://id.loc.gov')
435+
} else { // if it's not dev or public make sure we're using 8080
436+
url = url.replace('https://id.loc.gov', 'https://preprod-8080.id.loc.gov')
435437
}
436438

437439

@@ -562,11 +564,15 @@ const utilsNetwork = {
562564
* @return {array} - An array of {@link contextResult} results
563565
*/
564566
returnContext: async function(uri){
567+
let returnUrls = useConfigStore().returnUrls
565568
let results
566569
let d
567570
try {
568571
d = await this.fetchContextData(uri)
569572
d.uri = uri
573+
if (returnUrls.env == 'production'){
574+
d.uri = uri.replace('http://id.', 'https://preprod-8080.id.')
575+
}
570576
} catch {
571577
return false
572578
}
@@ -647,7 +653,7 @@ const utilsNetwork = {
647653
}
648654

649655

650-
jsonuri = jsonuri.replace('http://id.loc.gov','https://id.loc.gov')
656+
jsonuri = jsonuri.replace('http://','https://')
651657

652658
// let data2 = [ { "@id": "_:b600iddOtlocdOtgovauthoritiesnamesn79021164", "@type": [ "http://www.loc.gov/mads/rdf/v1#Source" ], "http://www.loc.gov/mads/rdf/v1#citationSource": [ { "@value": "Hatěntir patmwatskʻner, 1963:" } ], "http://www.loc.gov/mads/rdf/v1#citationNote": [ { "@value": "title page (Markʻ Tʻuēyn)" } ], "http://www.loc.gov/mads/rdf/v1#citationStatus": [ { "@value": "found" } ] }, { "@id": "_:b399iddOtlocdOtgovauthoritiesnamesn79021164", "@type": [ "http://www.loc.gov/mads/rdf/v1#DateNameElement" ], "http://www.loc.gov/mads/rdf/v1#elementValue": [ { "@value": "1835-1910" } ] }, { "@id": "_:b626iddOtlocdOtgovauthoritiesnamesn79021164", "@type": [ "http://id.loc.gov/ontologies/RecordInfo#RecordInfo" ], "http://id.loc.gov/ontologies/RecordInfo#recordChangeDate": [ { "@type": "http://www.w3.org/2001/XMLSchema#dateTime",
653659
// "@value": "1979-04-18T00:00:00" } ], "http://id.loc.gov/ontologies/RecordInfo#recordStatus": [ { "@type": "http://www.w3.org/2001/XMLSchema#string",

src/stores/config.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ export const useConfigStore = defineStore('config', {
77

88
versionMajor: 0,
99
versionMinor: 18,
10-
versionPatch: 5,
10+
versionPatch: 6,
1111

1212
regionUrls: {
1313

0 commit comments

Comments
 (0)