mirror of
https://github.com/immich-app/immich
synced 2026-08-29 13:15:45 +00: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:
parent
cf4ec06750
commit
0130591a0f
10 changed files with 89 additions and 17 deletions
|
|
@ -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,
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue