diff --git a/src/app/affiliation/[shortName]/findDocumentsByAffiliation.ts b/src/app/affiliation/[shortName]/findDocumentsByAffiliation.ts index af90149..8ef2f60 100644 --- a/src/app/affiliation/[shortName]/findDocumentsByAffiliation.ts +++ b/src/app/affiliation/[shortName]/findDocumentsByAffiliation.ts @@ -8,16 +8,17 @@ interface DocumentWithSlug { doc: Document } -const findDocumentsByAuthor = ( - authorId: string -): DocumentWithSlug[] => { +const findDocumentsByAuthor = (authorId: string): DocumentWithSlug[] => { // Filter documents by author return Object.entries(documents) .filter(([_, doc]) => doc.manifest.authors.includes(authorId)) .map(([slug, doc]) => ({ slug, doc })) } -const checkAffiliation = (affiliationStr: string[], affiliationShort: string) => { +const checkAffiliation = ( + affiliationStr: string[], + affiliationShort: string +) => { for (const affiliation of affiliationStr) { if (affiliation.split('@')[1] === affiliationShort) { return true @@ -33,11 +34,9 @@ export default function findDocumentsByAffiliationSorted( const results: DocumentWithSlug[] = [] for (const [key, value] of Object.entries(authors)) { if ( - checkAffiliation(value.affiliation, affiliationShort) - || ( - value.formerAffiliations - && checkAffiliation(value.formerAffiliations, affiliationShort) - ) + checkAffiliation(value.affiliation, affiliationShort) || + (value.formerAffiliations && + checkAffiliation(value.formerAffiliations, affiliationShort)) ) { // Check if document is already in results const additions = findDocumentsByAuthor(key) diff --git a/src/app/affiliation/[shortName]/page.tsx b/src/app/affiliation/[shortName]/page.tsx index 75793b0..66f8d26 100644 --- a/src/app/affiliation/[shortName]/page.tsx +++ b/src/app/affiliation/[shortName]/page.tsx @@ -28,9 +28,7 @@ export default function Page({ <> {description.split('[linebreak]').map((d, i) => ( <> -
- {d} -
+
{d}

))} @@ -62,18 +60,18 @@ export default function Page({ {affiliationDocuments.length > 0 && ( - <> -
-

- Related documents {`(${affiliationDocuments.length})`} -

- {affiliationDocuments.map((d) => ( - - - - ))} - - )} + <> +
+

+ Related documents {`(${affiliationDocuments.length})`} +

+ {affiliationDocuments.map((d) => ( + + + + ))} + + )} ) }