Skip to content

Commit

Permalink
Merge pull request #76 from abinth11/bug-fix-instructor-register
Browse files Browse the repository at this point in the history
Bug fix instructor register
  • Loading branch information
abinth11 authored Sep 9, 2023
2 parents 3b0f078 + 6057c77 commit b6284a8
Show file tree
Hide file tree
Showing 5 changed files with 26 additions and 14 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -105,10 +105,10 @@ const PaymentConfirmationModal: React.FC<PaymentModalProps> = ({
</div>
</DialogHeader>
<DialogBody divider>
<Typography variant='body' className='font-semibold' color='gray'>
<Typography variant='paragraph' className='font-semibold text-md' color='gray'>
Please review the details before proceeding:
</Typography>
<Typography variant='body' color='gray' className='mt-2 mb-1'>
<Typography variant='paragraph' color='gray' className='mt-2 mb-1'>
{isFreeCourse ? (
<span className='font-semibold text-green-500'>
This course is free!
Expand All @@ -135,7 +135,7 @@ const PaymentConfirmationModal: React.FC<PaymentModalProps> = ({

)}
</Typography>
<Typography variant='body' color='gray'>
<Typography variant='paragraph' color='gray'>
<span className='font-semibold'>Course Overview:</span><br />
{courseDetails?.overview}
</Typography>
Expand Down
1 change: 1 addition & 0 deletions client/src/components/pages/course-pages/pdf-viewer.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ interface PdfViewerProps {
}

const PdfViewer: React.FC<PdfViewerProps> = ({ pdfUrl }) => {
console.log(pdfUrl)
return (
<div>
<Document file={pdfUrl}>
Expand Down
16 changes: 9 additions & 7 deletions client/src/components/pages/course-pages/view-course.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -197,13 +197,15 @@ const ViewCourseStudent: React.FC = () => {
{expandedIndex === 0 && (
<li className=''>
<ul>
<li
className='p-6 border-b flex items-center cursor-pointer hover:bg-customBlueShade'
onClick={handleLiClick}
>
<IoBookSharp className='mr-2 text-blue-500' />
<span className='flex-1'>Important guidelines</span>
</li>
<Link to={course?.guidelinesUrl ?? ""} target="_blank" rel="noopener noreferrer" >
<li
className='p-6 border-b flex items-center cursor-pointer hover:bg-customBlueShade'
// onClick={handleLiClick}
>
<IoBookSharp className='mr-2 text-blue-500' />
<span className='flex-1'>Important guidelines</span>
</li>
</Link>
{showPdf && (
<PdfViewer pdfUrl={course?.guidelinesUrl ?? ""} />
)}
Expand Down
1 change: 1 addition & 0 deletions server/src/adapters/controllers/courseController.ts
Original file line number Diff line number Diff line change
Expand Up @@ -143,6 +143,7 @@ const courseController = (
cloudService,
dbRepositoryCourse
);
console.log(course)
res.status(200).json({
status: 'success',
message: 'Successfully retrieved the course',
Expand Down
16 changes: 12 additions & 4 deletions server/src/app/usecases/auth/instructorAuth.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,16 +15,23 @@ export const instructorRegister = async (
instructorRepository: ReturnType<InstructorDbInterface>,
authService: ReturnType<AuthServiceInterface>
) => {
instructor.certificates = []
console.log(instructor);
instructor.certificates = [];
instructor.profilePic = {
name: '',
key: '',
url: ''
};
if (files) {
files.map((file) => {
if (file.originalname === 'profilePic') {
instructor.profilePic.url = file.path;
instructor.profilePic.name=file.originalname
} else {
const certificate = {
name:file.originalname,
url:file.path
}
name: file.originalname,
url: file.path
};
instructor.certificates.push(certificate);
}
});
Expand All @@ -42,6 +49,7 @@ export const instructorRegister = async (
if (password) {
instructor.password = await authService.hashPassword(password);
}
console.log(instructor)
const response = await instructorRepository.addInstructor(instructor);
return response
? { status: true, message: 'successfully registered!' }
Expand Down

0 comments on commit b6284a8

Please sign in to comment.