diff --git a/src/controllers/user.ts b/src/controllers/user.ts index 0f88ce4..f0c6bf3 100644 --- a/src/controllers/user.ts +++ b/src/controllers/user.ts @@ -884,7 +884,7 @@ export class UserController { password: { type: "string", description: "Password" }, name: { type: "string", description: "name" }, 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 }); if (data != null) { - const doctorprofile = await UserController.uploadFile(req.files, ""); - if (doctorprofile) { - if (data.profile_picture) { - const oldFilePath = path.join(STORAGE_DIR, data.profile_picture); - await UserController.deleteFile(oldFilePath); - } - data.profile_picture = doctorprofile; - } - + // const doctorprofile = await UserController.uploadFile(req.files, ""); + // if (doctorprofile) { + // if (data.profile_picture) { + // const oldFilePath = path.join(STORAGE_DIR, data.profile_picture); + // await UserController.deleteFile(oldFilePath); + // } + // } + + data.profile_picture = param.profile_picture || data.profile_picture; data.name = param.name; data.username = param.username; data.email = param.email;