diff --git a/server/src/app/usecases/auth/instructorAuth.ts b/server/src/app/usecases/auth/instructorAuth.ts index 7a53d9f..c059ea9 100644 --- a/server/src/app/usecases/auth/instructorAuth.ts +++ b/server/src/app/usecases/auth/instructorAuth.ts @@ -15,16 +15,23 @@ export const instructorRegister = async ( instructorRepository: ReturnType, authService: ReturnType ) => { - 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); } }); @@ -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!' }