This commit is contained in:
longdayi 2025-02-27 08:03:31 +08:00
parent 4c13d70a28
commit 51b37068d0
2 changed files with 11 additions and 7 deletions

View File

@ -1,20 +1,22 @@
import CourseList from "@web/src/components/models/course/list/CourseList"; import PostList from "@web/src/components/models/course/list/PostList";
import { useAuth } from "@web/src/providers/auth-provider"; import { useAuth } from "@web/src/providers/auth-provider";
import CourseCard from "../courses/components/CourseCard";
export default function MyDutyPage() { export default function MyDutyPage() {
const { user } = useAuth(); const { user } = useAuth();
return ( return (
<> <>
<div className="p-4"> <div className="p-4">
<CourseList <PostList
edit renderItem={post=><CourseCard edit course={post}></CourseCard>}
params={{ params={{
pageSize: 12, pageSize: 12,
where: { where: {
authorId: user.id, authorId: user.id,
}, },
}} }}
cols={4}></CourseList> cols={4}></PostList>
</div> </div>
</> </>
); );

View File

@ -1,12 +1,14 @@
import CourseList from "@web/src/components/models/course/list/CourseList"; import PostList from "@web/src/components/models/course/list/PostList";
import { useAuth } from "@web/src/providers/auth-provider"; import { useAuth } from "@web/src/providers/auth-provider";
import CourseCard from "../courses/components/CourseCard";
export default function MyLearningPage() { export default function MyLearningPage() {
const { user } = useAuth(); const { user } = useAuth();
return ( return (
<> <>
<div className="p-4"> <div className="p-4">
<CourseList <PostList
renderItem={post => <CourseCard edit={false} course={post}></CourseCard>}
params={{ params={{
pageSize: 12, pageSize: 12,
where: { where: {
@ -17,7 +19,7 @@ export default function MyLearningPage() {
}, },
}, },
}} }}
cols={4}></CourseList> cols={4}></PostList>
</div> </div>
</> </>
); );