update
This commit is contained in:
@ -138,7 +138,7 @@ export class UserController {
|
|||||||
...user,
|
...user,
|
||||||
profile_picture: user.profile_picture ?? null,
|
profile_picture: user.profile_picture ?? null,
|
||||||
file_profile_picture: user.profile_picture
|
file_profile_picture: user.profile_picture
|
||||||
? `${config.server.host_swagger}uploads/doctor-picture/${user.profile_picture}`
|
? `${config.server.host_swagger}uploads/doctor-profile/${user.profile_picture}`
|
||||||
: null,
|
: null,
|
||||||
}));
|
}));
|
||||||
|
|
||||||
@ -719,10 +719,10 @@ export class UserController {
|
|||||||
const data = await userRepository.findOneBy({ id: param.id });
|
const data = await userRepository.findOneBy({ id: param.id });
|
||||||
|
|
||||||
if (data != null) {
|
if (data != null) {
|
||||||
const doctorprofile = await UserController.uploadFile(req.files, 'profile_picture', 'uploads/doctor-picture');
|
const doctorprofile = await UserController.uploadFile(req.files, 'profile_picture', 'uploads/doctor-profile');
|
||||||
if (doctorprofile) {
|
if (doctorprofile) {
|
||||||
if (data.profile_picture) {
|
if (data.profile_picture) {
|
||||||
const oldFilePath = path.join('uploads/doctor-picture', data.profile_picture);
|
const oldFilePath = path.join('uploads/doctor-profile', data.profile_picture);
|
||||||
await UserController.deleteFile(oldFilePath);
|
await UserController.deleteFile(oldFilePath);
|
||||||
}
|
}
|
||||||
data.profile_picture = doctorprofile;
|
data.profile_picture = doctorprofile;
|
||||||
|
|||||||
Reference in New Issue
Block a user