fix read students reactions

This commit is contained in:
Primakov Alexandr Alexandrovich 2025-03-27 13:45:42 +03:00
parent 424013c570
commit 245d56410d
3 changed files with 5 additions and 5 deletions

View File

@ -59,7 +59,7 @@ export interface Lesson {
id: string; id: string;
_id: string; _id: string;
name: string; name: string;
reactions: Reaction[]; studentReactions: Reaction[];
students: User[]; students: User[];
teachers: Teacher[]; teachers: Teacher[];
date: string; date: string;

View File

@ -127,8 +127,8 @@ const LessonDetail = () => {
// Эффект для обработки новых реакций // Эффект для обработки новых реакций
useEffect(() => { useEffect(() => {
if (accessCode?.body?.lesson?.reactions) { if (accessCode?.body?.lesson?.studentReactions) {
const reactions = accessCode.body.lesson.reactions; const reactions = accessCode.body.lesson.studentReactions;
// Группируем реакции по sub (идентификатору студента) // Группируем реакции по sub (идентификатору студента)
const groupedReactions: Record<string, Reaction[]> = {}; const groupedReactions: Record<string, Reaction[]> = {};
@ -161,7 +161,7 @@ const LessonDetail = () => {
return () => clearTimeout(clearReactionsTimeout); return () => clearTimeout(clearReactionsTimeout);
} }
}, [accessCode?.body?.lesson?.reactions]); }, [accessCode?.body?.lesson?.studentReactions]);
useEffect(() => { useEffect(() => {
if (manualAddRqst.isSuccess) { if (manualAddRqst.isSuccess) {

View File

@ -27,7 +27,7 @@
"picture": "https://lh3.googleusercontent.com/a/ACg8ocJUtJBAVBm642AxoGpMDDMV8CPu3MEoLjU3hmO7oisG=s96-c" "picture": "https://lh3.googleusercontent.com/a/ACg8ocJUtJBAVBm642AxoGpMDDMV8CPu3MEoLjU3hmO7oisG=s96-c"
} }
], ],
"reactions": [ "studentReactions": [
{ {
"_id": "r1d73f22-c9ba-422a-b572-c59e515a2901", "_id": "r1d73f22-c9ba-422a-b572-c59e515a2901",
"sub": "fcde3f22-d9ba-412a-a572-c59e515a290f", "sub": "fcde3f22-d9ba-412a-a572-c59e515a290f",