fix(server,web): correctly show album level like (#4916)
* fix: like in global activity * refactor: rename isGlobal to ReactionLevel.Album * chore: open api * chore: e2e test for album vs comment duplicate like checking --------- Co-authored-by: Jason Rasmussen <jrasm91@gmail.com>
This commit is contained in:
@@ -6,10 +6,9 @@ import { ActivityEntity } from '../entities/activity.entity';
|
||||
|
||||
export interface ActivitySearch {
|
||||
albumId?: string;
|
||||
assetId?: string;
|
||||
assetId?: string | null;
|
||||
userId?: string;
|
||||
isLiked?: boolean;
|
||||
isGlobal?: boolean;
|
||||
}
|
||||
|
||||
@Injectable()
|
||||
@@ -17,11 +16,11 @@ export class ActivityRepository implements IActivityRepository {
|
||||
constructor(@InjectRepository(ActivityEntity) private repository: Repository<ActivityEntity>) {}
|
||||
|
||||
search(options: ActivitySearch): Promise<ActivityEntity[]> {
|
||||
const { userId, assetId, albumId, isLiked, isGlobal } = options;
|
||||
const { userId, assetId, albumId, isLiked } = options;
|
||||
return this.repository.find({
|
||||
where: {
|
||||
userId,
|
||||
assetId: isGlobal ? IsNull() : assetId,
|
||||
assetId: assetId === null ? IsNull() : assetId,
|
||||
albumId,
|
||||
isLiked,
|
||||
},
|
||||
|
||||
Reference in New Issue
Block a user