Skip to content

Commit

Permalink
Merge branch 'staging'
Browse files Browse the repository at this point in the history
  • Loading branch information
annelhote committed Sep 26, 2024
2 parents 9d875e6 + 7bc781d commit fca61ae
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions server/src/routes/works.routes.js
Original file line number Diff line number Diff line change
Expand Up @@ -48,12 +48,12 @@ const getData = async ({ options, resetCache = false }) => {
shasum.update(JSON.stringify(options));
const searchId = shasum.digest('hex');
const queryId = Math.floor(Math.random() * SEED_MAX);
console.time(`0. Query ${queryId} | Retrieve cache if exists ${options.affiliationStrings}`);
let cache = false;
if (USE_CACHE) {
console.time(`0. Query ${queryId} | Retrieve cache if exists ${options.affiliationStrings}`);
cache = await getCache({ searchId });
console.timeEnd(`0. Query ${queryId} | Retrieve cache if exists ${options.affiliationStrings}`);
}
console.timeEnd(`0. Query ${queryId} | Retrieve cache if exists ${options.affiliationStrings}`);
if (cache && !resetCache) {
const extractionDate = new Date(cache.extractionDate);
console.log(`0. Query ${queryId}`, `returning cached data from ${extractionDate}`);
Expand Down
2 changes: 1 addition & 1 deletion server/src/utils/works.js
Original file line number Diff line number Diff line change
Expand Up @@ -440,7 +440,7 @@ const groupByAffiliations = ({ options, works }) => {
const matches = regexp.exec(displayAffiliation);
// Set each matched word in bold
matches?.slice(1)?.forEach((match) => {
displayAffiliation = displayAffiliation.replace(match, '<b>$&</b>');
displayAffiliation = displayAffiliation.replaceAll(match, '<b>$&</b>');
});
let keepAffiliation = displayAffiliation.includes('</b>');
const rorsInAffiliation = affiliation.rors?.map((a) => a.rorId) || [];
Expand Down

0 comments on commit fca61ae

Please sign in to comment.