Skip to content

Commit

Permalink
just logs and stuff
Browse files Browse the repository at this point in the history
  • Loading branch information
EdwinGuzman committed Sep 18, 2024
1 parent 9f79eea commit f487f1e
Show file tree
Hide file tree
Showing 4 changed files with 21 additions and 7 deletions.
7 changes: 3 additions & 4 deletions src/app/components/ResultsList/ResultsList.jsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
import { Text, Card, CardHeading, CardActions, CardContent, DSLink } from '@nypl/design-system-react-components';
import { Text, Card, CardHeading, CardActions, CardContent, Link as DSLink } from '@nypl/design-system-react-components';
import React from 'react';
import PropTypes from 'prop-types';
import { Link } from 'react-router';
import {
isEmpty as _isEmpty,
isArray as _isArray,
Expand Down Expand Up @@ -117,7 +116,7 @@ const ResultsList = ({
});
}
}
to={bibUrl}
href={bibUrl}
className="title">
{bibTitle}
</DSLink>
Expand Down Expand Up @@ -157,7 +156,7 @@ const ResultsList = ({
(<CardActions className="results-items-element">
<DSLink
onClick={resourcesOnClick}
to={`${bibUrl}#items-table`}
href={`${bibUrl}#items-table`}
className="search-results-list-link"
id="physical-items-link"
>
Expand Down
17 changes: 14 additions & 3 deletions src/server/ApiRoutes/SubjectHeading.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,10 @@ import logger from '../../../logger';
import SubjectHeadings from './SubjectHeadings';

const nyplApiClientCall = query => nyplApiClient()
.then(client => client.get(`/discovery/resources${query}`, { cache: false }))
.then(client => {
console.log(`/discovery/resources${query}`)
return client.get(`/discovery/resources${query}`, { cache: false })
})
.catch(console.error);

function fetchBibs(page, perPage, sortBy, order, subjectLiteral, shepApiBibCount, cb, errorcb) {
Expand All @@ -31,6 +34,7 @@ const bibsAjax = (req, res) => {
const { subjectLiteral } = req.params;
const { page, perPage, sort, order } = getReqParams(req.query);
const shepApiBibCount = req.query.shep_bib_count;
console.log({shepApiBibCount})
const bibsSource = req.query.source;

const shepApiBibsCall = () => {
Expand Down Expand Up @@ -66,15 +70,22 @@ const bibsAjax = (req, res) => {

const processData = (data) => {
const { totalResults } = data;
if (bibsSource === 'discoveryApi' || useDiscoveryResults(totalResults)) {
console.log({bibsSource})
console.log(useDiscoveryResults(totalResults))
console.log({shepApiBibCount})
console.log(data)
if (true) {
// if (bibsSource === 'discoveryApi' || useDiscoveryResults(totalResults)) {
console.log('Using Discovery API');
return res.json({
results: data.itemListElement,
page,
totalResults,
bibsSource: 'discoveryApi',
});
}


console.log('Using SHEP API');
return shepApiBibsCall();
};

Expand Down
1 change: 1 addition & 0 deletions src/server/ApiRoutes/SubjectHeadings.js
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,7 @@ const shepApiCall = (path, queryParams) => {
const timeout = setTimeout(() => {
source.cancel()
}, 5000)
console.log({path})
return axios({
method: 'GET',
url: `${appConfig.shepApi}${path}`,
Expand Down
3 changes: 3 additions & 0 deletions src/server/routes/nyplApiClient/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,9 @@ function nyplApiClient(options = { apiName: 'platform' }) {
}

const baseUrl = config.api[apiName][appEnvironment];
console.log({apiName})
console.log({appEnvironment})
console.log({baseUrl})

if (kmsEnvironment === 'encrypted') {
return new Promise((resolve, reject) => {
Expand Down

0 comments on commit f487f1e

Please sign in to comment.