Skip to content

Commit

Permalink
Fix links to publications
Browse files Browse the repository at this point in the history
  • Loading branch information
mmihalik committed Dec 14, 2024
1 parent 03818f6 commit d9ed771
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 11 deletions.
15 changes: 5 additions & 10 deletions src/components/Archive/Archive.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -20,12 +20,11 @@ type MyEvent = Omit<Event, 'publication_set'> & {
}

const PublicationButton: FC<{
publicationId: number
publicationName: string
}> = ({publicationId, publicationName}) => {
publication: Publication
}> = ({publication}) => {
return (
<Link variant="button2" href={`/api/competition/publication/${publicationId}/download`} target="_blank">
Časopis {publicationName}
<Link variant="button2" href={`/api${publication.file}`} target="_blank">
{publication.name}
</Link>
)
}
Expand Down Expand Up @@ -79,11 +78,7 @@ export const Archive: FC = () => {
<ResultsButton eventYear={event.year} eventSeason={event.season_code} />
<ProblemsButton eventYear={event.year} eventSeason={event.season_code} />
{event.publication_set.map((publication) => (
<PublicationButton
key={publication.id}
publicationId={publication.id}
publicationName={publication.name}
/>
<PublicationButton key={publication.id} publication={publication} />
))}
</Stack>
</Stack>
Expand Down
2 changes: 1 addition & 1 deletion src/components/PublicationUploader/PublicationUploader.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ export const PublicationUploader: FC<PublicationUploaderProps> = ({semesterId, o
<Stack direction="row" gap={2} alignItems="center">
<Typography variant="body1">{order}. Časopis:</Typography>
{publication && (
<Link variant="button2" href={`/api/competition/publication/${publication.id}/download`}>
<Link variant="button2" href={`/api${publication.file}`}>
{publication.name}
</Link>
)}
Expand Down

0 comments on commit d9ed771

Please sign in to comment.