починил добавление и удаление ответа на задание

This commit is contained in:
Андрей Дувакин 2025-11-29 17:03:06 +05:00
parent d57f2de2da
commit 45a4f278ca
2 changed files with 36 additions and 35 deletions

View File

@ -183,17 +183,17 @@ const ViewTaskModal = () => {
> >
<div style={{marginBottom: 16}}> <div style={{marginBottom: 16}}>
<Text strong>Ответ:</Text> <Text strong>Ответ:</Text>
<Paragraph <div
style={{ style={{
background: "#f9f9f9", background: "#f9f9f9",
padding: 12, padding: 16,
borderRadius: 8, borderRadius: 8,
margin: "8px 0", margin: "12px 0",
whiteSpace: "pre-wrap", border: "1px solid #f0f0f0",
minHeight: 60,
}} }}
> dangerouslySetInnerHTML={{__html: solution.answer_text || "<em>Текст ответа отсутствует</em>"}}
{solution.answer_text} />
</Paragraph>
</div> </div>
{solution.files && solution.files.length > 0 ? ( {solution.files && solution.files.length > 0 ? (

View File

@ -103,7 +103,7 @@ const useViewTaskModal = () => {
}); });
} }
} }
setDraftFiles([]);
notification.success({ notification.success({
title: "Успех", title: "Успех",
description: "Задание успешно создано!", description: "Задание успешно создано!",
@ -114,6 +114,7 @@ const useViewTaskModal = () => {
editorRef.current.value = ""; editorRef.current.value = "";
} }
} catch (error) { } catch (error) {
console.error(error)
notification.error({ notification.error({
title: "Ошибка", title: "Ошибка",
description: error?.data?.detail || "Не удалось создать задание", description: error?.data?.detail || "Не удалось создать задание",