Skip to content

Commit

Permalink
fix(image): fix course image update issue
Browse files Browse the repository at this point in the history
  • Loading branch information
faisalEsMagico committed Dec 15, 2023
1 parent 5266bd6 commit dd4274e
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 3 deletions.
7 changes: 5 additions & 2 deletions src/components/Course/SingleCourse.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,6 @@ const SingleCourse = ({
setShowPopUp(false);
}
};

document.body.addEventListener('click', closeDropDown);
return () => document.body.removeEventListener('click', closeDropDown);
}, [showPopUp]);
Expand All @@ -115,7 +114,11 @@ const SingleCourse = ({
{/* image */}
<div className='flex-shrink-0'>
<Image
src={typeof course?.imageLink === 'string' ? course?.imageLink : ''}
src={
typeof course?.imageLink === 'string'
? `${course?.imageLink}?date=${new Date().getTime()}`
: ''
}
width={100}
height={100}
alt='course-image'
Expand Down
2 changes: 1 addition & 1 deletion src/components/inputtag/ImageUpload.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ const ImageUpload = ({
<Image
src={
value && typeof value === 'string'
? value
? `${value}?date=${new Date().getTime()}`
: `data:image/jpeg;base64,${image}`
}
alt='course img'
Expand Down

0 comments on commit dd4274e

Please sign in to comment.