diff --git a/src/controllers/user.ts b/src/controllers/user.ts index ac81220..9c1444d 100644 --- a/src/controllers/user.ts +++ b/src/controllers/user.ts @@ -138,7 +138,7 @@ export class UserController { ...user, profile_picture: user.profile_picture ?? null, file_profile_picture: user.profile_picture - ? `${config.server.host_swagger}uploads/profile-picture/${user.profile_picture}` + ? `${config.server.host_swagger}uploads/doctor-picture/${user.profile_picture}` : null, })); @@ -719,10 +719,10 @@ export class UserController { const data = await userRepository.findOneBy({ id: param.id }); if (data != null) { - const doctorprofile = await UserController.uploadFile(req.files, 'profile_picture', 'uploads/profile-picture'); + const doctorprofile = await UserController.uploadFile(req.files, 'profile_picture', 'uploads/doctor-picture'); if (doctorprofile) { if (data.profile_picture) { - const oldFilePath = path.join('uploads/profile-picture', data.profile_picture); + const oldFilePath = path.join('uploads/doctor-picture', data.profile_picture); await UserController.deleteFile(oldFilePath); } data.profile_picture = doctorprofile;