refactor(server): user profile picture (#4728)

This commit is contained in:
Jason Rasmussen
2023-10-30 19:38:34 -04:00
committed by GitHub
parent 431536cdbb
commit 3212a47720
5 changed files with 49 additions and 30 deletions

View File

@@ -123,15 +123,6 @@ export class UserCore {
}
}
async createProfileImage(authUser: AuthUserDto, filePath: string): Promise<UserEntity> {
try {
return this.userRepository.update(authUser.id, { profileImagePath: filePath });
} catch (e) {
Logger.error(e, 'Create User Profile Image');
throw new InternalServerErrorException('Failed to create new user profile image');
}
}
async restoreUser(authUser: AuthUserDto, userToRestore: UserEntity): Promise<UserEntity> {
if (!authUser.isAdmin) {
throw new ForbiddenException('Unauthorized');