diff --git a/server/src/use_case/doctor/AuthenticationUseCase.ts b/server/src/use_case/doctor/AuthenticationUseCase.ts index dc7a9694..c6d7a723 100644 --- a/server/src/use_case/doctor/AuthenticationUseCase.ts +++ b/server/src/use_case/doctor/AuthenticationUseCase.ts @@ -131,7 +131,7 @@ export default class AuthenticationUseCase { this.validatorService.validateIdFormat(id); const doctor = await this.doctorRepository.findByID(id); if (!doctor) throw new CustomError("Not Found", StatusCode.NotFound); - const key = `profile-images/${id}-${Date.now()}`; + const key = `profile-images/doctor/${id}-${Date.now()}`; const url = await this.cloudService.generatePreSignedUrl(process.env.S3_BUCKET_NAME!, key, 30); return { url, key }; } diff --git a/server/src/use_case/patient/PatientUseCases.ts b/server/src/use_case/patient/PatientUseCases.ts index 5f30e734..cf3e71cd 100644 --- a/server/src/use_case/patient/PatientUseCases.ts +++ b/server/src/use_case/patient/PatientUseCases.ts @@ -38,7 +38,7 @@ export default class PatientUseCase { const patient = await this.patientRepository.findById(id); if (!patient) throw new CustomError("Patient not found", StatusCode.NotFound); - const key = `profile-images/${id}-${Date.now()}`; + const key = `profile-images/patient/${id}-${Date.now()}`; const url = await this.cloudStorageService.generatePreSignedUrl(process.env.S3_BUCKET_NAME!, key, 30); return { url, key }; }