pr feedback
This commit is contained in:
parent
3d6eadb595
commit
610b03d16c
1 changed files with 3 additions and 3 deletions
|
@ -93,10 +93,10 @@ export class UserService {
|
|||
authUser: AuthUserDto,
|
||||
fileInfo: Express.Multer.File,
|
||||
): Promise<CreateProfileImageResponseDto> {
|
||||
const user = await this.findOrFail(authUser.id, { withDeleted: false });
|
||||
const { profileImagePath: oldpath } = await this.findOrFail(authUser.id, { withDeleted: false });
|
||||
const updatedUser = await this.userRepository.update(authUser.id, { profileImagePath: fileInfo.path });
|
||||
if (user.profileImagePath !== '') {
|
||||
const files = [user.profileImagePath];
|
||||
if (oldpath !== '') {
|
||||
const files = [oldpath];
|
||||
await this.jobRepository.queue({ name: JobName.DELETE_FILES, data: { files } });
|
||||
}
|
||||
return mapCreateProfileImageResponse(updatedUser.id, updatedUser.profileImagePath);
|
||||
|
|
Loading…
Reference in a new issue