update
This commit is contained in:
@ -884,7 +884,7 @@ export class UserController {
|
|||||||
password: { type: "string", description: "Password" },
|
password: { type: "string", description: "Password" },
|
||||||
name: { type: "string", description: "name" },
|
name: { type: "string", description: "name" },
|
||||||
status: { type: "string", description: "Status" },
|
status: { type: "string", description: "Status" },
|
||||||
profile_picture: { type: "string", format: "binary", description: "Image file (max 1MB, jpg/png/webp)" }
|
profile_picture: { type: "string", description: "String" }
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -913,15 +913,15 @@ 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, "");
|
// const doctorprofile = await UserController.uploadFile(req.files, "");
|
||||||
if (doctorprofile) {
|
// if (doctorprofile) {
|
||||||
if (data.profile_picture) {
|
// if (data.profile_picture) {
|
||||||
const oldFilePath = path.join(STORAGE_DIR, data.profile_picture);
|
// const oldFilePath = path.join(STORAGE_DIR, data.profile_picture);
|
||||||
await UserController.deleteFile(oldFilePath);
|
// await UserController.deleteFile(oldFilePath);
|
||||||
}
|
// }
|
||||||
data.profile_picture = doctorprofile;
|
// }
|
||||||
}
|
|
||||||
|
data.profile_picture = param.profile_picture || data.profile_picture;
|
||||||
data.name = param.name;
|
data.name = param.name;
|
||||||
data.username = param.username;
|
data.username = param.username;
|
||||||
data.email = param.email;
|
data.email = param.email;
|
||||||
|
|||||||
Reference in New Issue
Block a user