change caching of profile image
This commit is contained in:
@@ -116,6 +116,14 @@ export class UserCore {
|
||||
return createReadStream(user.profileImagePath);
|
||||
}
|
||||
|
||||
async getUserProfileImageHash(user: UserEntity): Promise<string> {
|
||||
if (!user.profileImageHash) {
|
||||
throw new NotFoundException('User does not have a profile image');
|
||||
}
|
||||
return user.profileImageHash;
|
||||
|
||||
|
||||
|
||||
async getList(filter?: UserListFilter): Promise<UserEntity[]> {
|
||||
return this.userRepository.getList(filter);
|
||||
}
|
||||
|
||||
@@ -120,6 +120,14 @@ export class UserService {
|
||||
return this.userCore.getUserProfileImage(user);
|
||||
}
|
||||
|
||||
async getUserProfileImageHash(userId: string): Promise<string> {
|
||||
const user = await this.userCore.get(userId);
|
||||
if (!user) {
|
||||
throw new NotFoundException('User not found');
|
||||
}
|
||||
return this.userCore.getUserProfileImageHash(user);
|
||||
}
|
||||
|
||||
async resetAdminPassword(ask: (admin: UserResponseDto) => Promise<string | undefined>) {
|
||||
const admin = await this.userCore.getAdmin();
|
||||
if (!admin) {
|
||||
|
||||
Reference in New Issue
Block a user