update
This commit is contained in:
@ -878,10 +878,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/doctor-profile");
|
||||
const doctorprofile = await UserController.uploadFile(req.files, "", "assets/saude");
|
||||
if (doctorprofile) {
|
||||
if (data.profile_picture) {
|
||||
const oldFilePath = path.join("uploads/doctor-profile", data.profile_picture);
|
||||
const oldFilePath = path.join("assets/saude", data.profile_picture);
|
||||
await UserController.deleteFile(oldFilePath);
|
||||
}
|
||||
data.profile_picture = doctorprofile;
|
||||
|
||||
Reference in New Issue
Block a user