Skip to content

Commit

Permalink
correcting published papers vs accepted papers
Browse files Browse the repository at this point in the history
  • Loading branch information
c2d13p committed Jul 12, 2024
1 parent 4d92386 commit 24f26e1
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 9 deletions.
8 changes: 4 additions & 4 deletions server/controllers/public/unimap.js
Original file line number Diff line number Diff line change
Expand Up @@ -51,26 +51,26 @@ async function unimapQuery(req, res) {
(link) => link ?? null
),
fetchFromAPI(
`${config.UNIPI_API_URL}arpicineca/1.0/getElencoPeriodo/${id}/9999`,
`${config.UNIPI_API_URL}arpicineca/1.0/getElencoPeriodo/${id}/${new Date().getFullYear()}`,
config.UNIPI_TOKENARPI,
'entries',
(entries) => entries?.entry ?? []
),
fetchFromAPI(
`${config.UNIPI_API_URL}arpicineca/1.0/getElencoPeriodo/${id}/${new Date().getFullYear()}`,
`${config.UNIPI_API_URL}arpicineca/1.0/getElencoPeriodo/${id}/9999`,
config.UNIPI_TOKENARPI,
'entries',
(entries) => entries?.entry ?? []
)
];

try {
const [registri, arpiLink, arpiPublications, arpiAcceptedPapers] = await Promise.all(fetchPromises);
const [registri, arpiLink, arpiPublishedPapers, arpiAcceptedPapers] = await Promise.all(fetchPromises);

res.json({
registri,
arpiLink,
arpiPublications,
arpiPublishedPapers,
arpiAcceptedPapers
});
} catch (error) {
Expand Down
10 changes: 5 additions & 5 deletions widgets/src/components/PersonDetails.js
Original file line number Diff line number Diff line change
Expand Up @@ -189,14 +189,14 @@ function UnimapData({data, en}) {

return (
<>
{((unimapData?.arpiPublications && unimapData.arpiPublications.length > 0) ||
{((unimapData?.arpiPublishedPapers && unimapData.arpiPublishedPapers.length > 0) ||
(unimapData?.arpiAcceptedPapers && unimapData.arpiAcceptedPapers.length > 0) ||
pubLinks.length > 0 ||
(data.grants && data.grants.length > 0) ||
(unimapData?.registri && unimapData.registri.length > 0)) &&
(unimapData && !unimapData.error) && (
<>
{(unimapData.arpiPublications && unimapData.arpiPublications.length > 0) ||
{(unimapData.arpiPublishedPapers && unimapData.arpiPublishedPapers.length > 0) ||
(unimapData.arpiAcceptedPapers && unimapData.arpiAcceptedPapers.length > 0) ||
pubLinks.length > 0 ||
(data.grants && data.grants.length > 0) ? (
Expand All @@ -208,10 +208,10 @@ function UnimapData({data, en}) {
<PublicationList publications={unimapData.arpiAcceptedPapers} />
</>
)}
{unimapData.arpiPublications && unimapData.arpiPublications.length > 0 && (
{unimapData.arpiPublishedPapers && unimapData.arpiPublishedPapers.length > 0 && (
<>
<h5 className="my-2">{en ? "Publications" : "Pubblicazioni"}</h5>
<PublicationList publications={unimapData.arpiPublications} />
<h5 className="my-2">{en ? "Published papers" : "Pubblicazioni"}</h5>
<PublicationList publications={unimapData.arpiPublishedPapers} />
</>
)}
{pubLinks.length > 0 && (
Expand Down

0 comments on commit 24f26e1

Please sign in to comment.