Ignore:
Timestamp:
01/20/23 22:57:18 (17 months ago)
Author:
viktor <viktor@…>
Branches:
main
Children:
8dffe02
Parents:
4abf55a
Message:

prefinal

File:
1 edited

Legend:

Unmodified
Added
Removed
  • reactapp/src/Pages/SearchResults.js

    r4abf55a r9bf1f8d  
    1414    <SearchResultsWrapper>
    1515      <h3 style={{ marginBottom: "30px" }}>Резултати од пребарувањето:</h3>
    16       {location.state.map((professor) => (
    17         <SearchResult key={professor.professorId} margin="10px">
    18           <SearchResultLink href={"/professor/" + professor.professorId}>
     16      {location.state.map((match) => (
     17        <SearchResult key={match.professorId !== undefined ? match.professorId : match.subjectId} margin="10px">
     18          <SearchResultLink href={`/${match.professorId !== undefined ? 'professor': 'subject'}/` + `${match.professorId !== undefined ? match.professorId : match.subjectId}`}>
    1919            <SearchResultText weight="bold" size="medium">
    20               {professor.professorName}
     20              {match.professorId !== undefined ? match.professorName : match.subjectName}
    2121            </SearchResultText>
    2222            <SearchResultText weight="normal" size="er">
    23               {professor.faculty.facultyName}
     23              {match.professorId !== undefined ? match.faculty.facultyName : match.studyProgramme.faculty.facultyName}
    2424            </SearchResultText>
    2525          </SearchResultLink>
Note: See TracChangeset for help on using the changeset viewer.