Skip to content

Commit 7ff5c29

Browse files
committed
Homework/Edit: исправление бэкендной валидации
1 parent 70f6a77 commit 7ff5c29

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

hwproj.front/src/components/Homeworks/CourseHomeworkExperimental.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -233,14 +233,14 @@ const CourseHomeworkEditor: FC<{
233233
isDeadlineStrict: metadata.isDeadlineStrict,
234234
publicationDate: metadata.publicationDate,
235235
actionOptions: editOptions,
236-
tasks: homework.tasks!.map(t => {
236+
tasks: isNewHomework ? homework.tasks!.map(t => {
237237
const task: CreateTaskViewModel = {
238238
...t,
239239
title: t.title!,
240240
maxRating: t.maxRating!
241241
}
242242
return task
243-
})
243+
}) : []
244244
}
245245

246246
const updatedHomework = isNewHomework

0 commit comments

Comments
 (0)