From 237d5a44d81af987b0b7204eba76533f5bb81bad Mon Sep 17 00:00:00 2001 From: ditiqi Date: Tue, 25 Feb 2025 16:43:42 +0800 Subject: [PATCH] addd --- .../src/app/main/home/components/CoursesSection.tsx | 12 +++++++----- packages/common/src/models/post.ts | 2 +- 2 files changed, 8 insertions(+), 6 deletions(-) diff --git a/apps/web/src/app/main/home/components/CoursesSection.tsx b/apps/web/src/app/main/home/components/CoursesSection.tsx index 2117baa..24bb307 100755 --- a/apps/web/src/app/main/home/components/CoursesSection.tsx +++ b/apps/web/src/app/main/home/components/CoursesSection.tsx @@ -6,7 +6,12 @@ import { TeamOutlined, ArrowRightOutlined, } from "@ant-design/icons"; -import { CourseDto, TaxonomySlug, TermDto } from "@nice/common"; +import { + courseDetailSelect, + CourseDto, + TaxonomySlug, + TermDto, +} from "@nice/common"; import { api } from "@nice/client"; import CourseCard from "../../courses/components/CourseCard"; interface GetTaxonomyProps { @@ -50,10 +55,7 @@ function useFetchCoursesByCategory(category: string) { }, }, take: 8, - include: { - terms: true, - depts: true, - }, + select: courseDetailSelect, }); return { data, isLoading }; diff --git a/packages/common/src/models/post.ts b/packages/common/src/models/post.ts index 6994d4b..0d2bf07 100755 --- a/packages/common/src/models/post.ts +++ b/packages/common/src/models/post.ts @@ -77,7 +77,7 @@ export type Course = Post & { export type CourseDto = Course & { enrollments?: Enrollment[]; sections?: SectionDto[]; - terms: Term[]; + terms: TermDto[]; lectureCount?: number; depts:Department[] };