fix courseId undefined

This commit is contained in:
Primakov Alexandr Alexandrovich 2025-04-06 18:07:15 +03:00
parent 40214cef3f
commit cb60801a74
2 changed files with 2 additions and 3 deletions

View File

@ -119,7 +119,6 @@ export const Item: React.FC<ItemProps> = ({
onCancel={() => { onCancel={() => {
setEdit(false) setEdit(false)
}} }}
courseId={courseId}
lesson={{ _id: id, id, name, date }} lesson={{ _id: id, id, name, date }}
title={t('journal.pl.lesson.editTitle')} title={t('journal.pl.lesson.editTitle')}
nameButton={t('journal.pl.save')} nameButton={t('journal.pl.save')}

View File

@ -46,6 +46,7 @@ import { dateToCalendarFormat } from '../../../utils/time'
import { Lesson } from '../../../__data__/model' import { Lesson } from '../../../__data__/model'
import { ErrorSpan } from '../style' import { ErrorSpan } from '../style'
import { api } from '../../../__data__/api/api' import { api } from '../../../__data__/api/api'
import { useParams } from 'react-router-dom'
const courceNameSuggestion = getFeatures('journal')['courceNameSuggestion'] const courceNameSuggestion = getFeatures('journal')['courceNameSuggestion']
@ -57,7 +58,6 @@ interface NewLessonForm {
interface LessonFormProps { interface LessonFormProps {
lesson?: Partial<Lesson> | any // Разрешаем передавать как Lesson, так и AI-сгенерированный урок lesson?: Partial<Lesson> | any // Разрешаем передавать как Lesson, так и AI-сгенерированный урок
courseId: string
isLoading: boolean isLoading: boolean
onCancel: () => void onCancel: () => void
onSubmit: (lesson: Lesson) => void onSubmit: (lesson: Lesson) => void
@ -74,7 +74,6 @@ interface LessonFormProps {
export const LessonForm = ({ export const LessonForm = ({
lesson, lesson,
courseId,
isLoading, isLoading,
onCancel, onCancel,
onSubmit, onSubmit,
@ -88,6 +87,7 @@ export const LessonForm = ({
onRetryAiGeneration = () => {}, onRetryAiGeneration = () => {},
existingLessons existingLessons
}: LessonFormProps) => { }: LessonFormProps) => {
const { courseId } = useParams()
const { t } = useTranslation() const { t } = useTranslation()
const isAiSuggested = lesson && !lesson._id && !lesson.id const isAiSuggested = lesson && !lesson._id && !lesson.id
const aiHighlightColor = useColorModeValue('blue.100', 'blue.800') const aiHighlightColor = useColorModeValue('blue.100', 'blue.800')