fix: include partner shared assets for people even without showInTimeline (#32226)
fix: include partner shared assets for people even without showInTimeline (#32219) (cherry picked from commit 5fa7789e2672350c76b9b026f2b8c2bc3ffdf7c4) Co-authored-by: Daniel Dietzler <36593685+danieldietzler@users.noreply.github.com>
This commit is contained in:
co-authored by
Daniel Dietzler
parent
1c284cd4ef
commit
28bd3a550b
@@ -1491,7 +1491,7 @@ describe(PersonService.name, () => {
|
||||
expect(mocks.access.person.checkAccess).toHaveBeenCalledWith(auth.user.id, new Set(ids), PERSON_READ_ROLES);
|
||||
});
|
||||
|
||||
it('should only include partners that are shown in the timeline', async () => {
|
||||
it('should include all partners that are shown in the timeline', async () => {
|
||||
const auth = AuthFactory.create();
|
||||
const person = PersonFactory.create();
|
||||
const ids = [{ personGroupId: person.personGroupId, ownerId: auth.user.id }];
|
||||
@@ -1507,7 +1507,7 @@ describe(PersonService.name, () => {
|
||||
await expect(sut.getStatistics(auth, person.personGroupId)).resolves.toEqual({ assets: 3 });
|
||||
expect(mocks.person.getStatistics).toHaveBeenCalledWith(person.personGroupId, {
|
||||
ownerId: auth.user.id,
|
||||
partnerIds: [inTimeline.id],
|
||||
partnerIds: [inTimeline.id, notInTimeline.id],
|
||||
});
|
||||
});
|
||||
|
||||
|
||||
@@ -80,7 +80,6 @@ export class PersonService extends BaseService {
|
||||
const partnerIds = await getMyPartnerIds({
|
||||
userId: auth.user.id,
|
||||
repository: this.partnerRepository,
|
||||
timelineEnabled: true,
|
||||
});
|
||||
const { items, hasNextPage } = await this.personRepository.getAllForUser(pagination, auth.user.id, {
|
||||
withHidden,
|
||||
@@ -213,7 +212,6 @@ export class PersonService extends BaseService {
|
||||
const partnerIds = await getMyPartnerIds({
|
||||
userId: auth.user.id,
|
||||
repository: this.partnerRepository,
|
||||
timelineEnabled: true,
|
||||
});
|
||||
return this.personRepository.getStatistics(personGroupId, { ownerId: auth.user.id, partnerIds });
|
||||
}
|
||||
|
||||
@@ -35,7 +35,7 @@ export class TimelineService extends BaseService {
|
||||
const partnerIds = await getMyPartnerIds({
|
||||
userId: auth.user.id,
|
||||
repository: this.partnerRepository,
|
||||
timelineEnabled: true,
|
||||
timelineEnabled: !options.personId || undefined,
|
||||
});
|
||||
userIds.push(...partnerIds);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user