mirror of
https://github.com/immich-app/immich.git
synced 2025-12-20 01:11:46 +03:00
fix: show/set activity like per user (#4775)
* fix: like per user * chore: open api * chore: e2e test for userId filtering
This commit is contained in:
@@ -38,6 +38,9 @@ export class ActivitySearchDto extends ActivityDto {
|
||||
@Optional()
|
||||
@ApiProperty({ enumName: 'ReactionType', enum: ReactionType })
|
||||
type?: ReactionType;
|
||||
|
||||
@ValidateUUID({ optional: true })
|
||||
userId?: string;
|
||||
}
|
||||
|
||||
const isComment = (dto: ActivityCreateDto) => dto.type === 'comment';
|
||||
|
||||
@@ -28,6 +28,7 @@ export class ActivityService {
|
||||
async getAll(authUser: AuthUserDto, dto: ActivitySearchDto): Promise<ActivityResponseDto[]> {
|
||||
await this.access.requirePermission(authUser, Permission.ALBUM_READ, dto.albumId);
|
||||
const activities = await this.repository.search({
|
||||
userId: dto.userId,
|
||||
albumId: dto.albumId,
|
||||
assetId: dto.assetId,
|
||||
isLiked: dto.type && dto.type === ReactionType.LIKE,
|
||||
|
||||
Reference in New Issue
Block a user