Skip to content

Commit

Permalink
Fix url for semester administration in menu (#298)
Browse files Browse the repository at this point in the history
add current semester to url
  • Loading branch information
vikibrezinova authored Dec 10, 2023
1 parent e98ecd6 commit 521cbc0
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/components/PageLayout/MenuMain/MenuMain.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ import {CloseButton} from '@/components/CloseButton/CloseButton'
import {Loading} from '@/components/Loading/Loading'
import Menu from '@/svg/menu.svg'
import {MenuItemShort} from '@/types/api/cms'
import {useDataFromURL} from '@/utils/useDataFromURL'
import {useHasPermissions} from '@/utils/useHasPermissions'
import {useSeminarInfo} from '@/utils/useSeminarInfo'

Expand All @@ -18,6 +19,7 @@ import styles from './MenuMain.module.scss'

export const MenuMain: FC = () => {
const {seminar, seminarId} = useSeminarInfo()
const {id} = useDataFromURL()

const {hasPermissions} = useHasPermissions()

Expand Down Expand Up @@ -72,7 +74,7 @@ export const MenuMain: FC = () => {
</Stack>
{hasPermissions && (
<Stack sx={{mt: 4, mx: 2, borderTop: '8px dashed white', pt: 4}}>
<MenuMainItem caption="TODO: Opravovanie" url={`/${seminar}/admin/opravovanie`} />
<MenuMainItem caption="TODO: Opravovanie" url={`/${seminar}/admin/opravovanie/${id.semesterId}`} />
<MenuMainItem caption="Admin" url="/admin" />
</Stack>
)}
Expand Down

0 comments on commit 521cbc0

Please sign in to comment.