+
{lesson.description ? (
{lesson.description}
) : (
@@ -140,11 +138,11 @@ const CourseDetailPage = () => {
)}
-
-
+
+
{userData?.first_name?.[0] || "У"}
-
+
Создал: {lesson.creator?.first_name} {lesson.creator?.last_name}
@@ -158,6 +156,7 @@ const CourseDetailPage = () => {
courseId={courseId}
/>
+
{[CONFIG.ROOT_ROLE_NAME, ROLES.TEACHER].includes(userData.role.title) && (
{
{courses.map((course) => (
navigate(`/courses/${course.id}`)}
-
hoverable
cover={
{
color: "white",
fontSize: 48,
}}
+ onClick={() => navigate(`/courses/${course.id}`)}
>
{course.title[0].toUpperCase()}
@@ -103,6 +102,7 @@ const CoursesPage = () => {
}
>
navigate(`/courses/${course.id}`)}
title={{course.title}}
description={
course.description || Без описания
diff --git a/web/src/Components/Pages/CoursesPage/useCoursesPage.js b/web/src/Components/Pages/CoursesPage/useCoursesPage.js
index b44b4fb..f6dc952 100644
--- a/web/src/Components/Pages/CoursesPage/useCoursesPage.js
+++ b/web/src/Components/Pages/CoursesPage/useCoursesPage.js
@@ -1,5 +1,5 @@
import {useGetAuthenticatedUserDataQuery} from "../../../Api/usersApi.js";
-import {useGetAllCoursesQuery} from "../../../Api/coursesApi.js";
+import {useGetAllCoursesQuery, useGetAllMyCoursesQuery} from "../../../Api/coursesApi.js";
import CONFIG from "../../../Core/сonfig.js";
import {ROLES} from "../../../Core/constants.js";
import {useDispatch} from "react-redux";
@@ -11,7 +11,7 @@ const useCoursesPage = () => {
const dispatch = useDispatch();
const {data: userData, isLoading: isUserLoading} = useGetAuthenticatedUserDataQuery();
- const {data: courses = [], isLoading, isCoursesLoading, isError} = useGetAllCoursesQuery(undefined, {
+ const {data: courses = [], isLoading, isCoursesLoading, isError} = useGetAllMyCoursesQuery(undefined, {
pollingInterval: 20000,
});