Skip to content

Commit

Permalink
UPDATE: Fix bugs for my learning page
Browse files Browse the repository at this point in the history
  • Loading branch information
MinEn1712 committed Apr 16, 2024
1 parent 69a1fc4 commit 7f91d56
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 11 deletions.
4 changes: 2 additions & 2 deletions src/api/user.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,10 +20,10 @@ export const callApiGetUserByEmail = async (userEmail) => {
return data;
}

export const callApiGetUserById = async (userId) => {
export const callApiGetUserById = async (id) => {
const { data } = await api.get('/users/id', {
params:{
userId
id
}
});
return data;
Expand Down
31 changes: 22 additions & 9 deletions src/page/myLearning/courseCard.js
Original file line number Diff line number Diff line change
Expand Up @@ -36,18 +36,31 @@ export default function CourseCard({ course }) {
return (
<Card sx={{ maxWidth: 250 }}>
<CardMedia
sx={{ height: 140 }}
image="/images/courses/reactnative.png"
sx={{ width: 250, height: 140 }}
image={course.imageUrl}
title={course.name}
/>
<CardContent sx={{paddingTop: 0}}>
<MyCourseCardItemName variant="h6" fontWeight={600}>
{course.name}
</MyCourseCardItemName>
<CardContent sx={{
height: 160,
paddingTop: 0,
paddingBottom: 0,
display: 'flex',
flexDirection: 'column',
justifyContent: 'space-between',
alignItems: 'space-between',
"&:last-child": {
paddingBottom: 1
}
}}>
<div>
<MyCourseCardItemName variant="h6" fontWeight={600}>
{course.name}
</MyCourseCardItemName>

<MyCourseCardItemDescription>
By {instructor ? instructor.metadata.fullName : ""}
</MyCourseCardItemDescription>
<MyCourseCardItemDescription>
By {instructor ? instructor.metadata.fullName : ""}
</MyCourseCardItemDescription>
</div>

<MyCourseRating>
<Rating name="simple-controlled" value={value} onChange={(event, newValue) => { setValue(newValue);}}/>
Expand Down

0 comments on commit 7f91d56

Please sign in to comment.