fix(server): include partner assets in random endpoint (#12599)

This commit is contained in:
Jason Rasmussen
2024-09-12 13:56:38 -04:00
committed by GitHub
parent d03e97f650
commit 7b737786b3
3 changed files with 10 additions and 10 deletions

View File

@@ -98,7 +98,12 @@ export class AssetService {
}
async getRandom(auth: AuthDto, count: number): Promise<AssetResponseDto[]> {
const assets = await this.assetRepository.getRandom(auth.user.id, count);
const partnerIds = await getMyPartnerIds({
userId: auth.user.id,
repository: this.partnerRepository,
timelineEnabled: true,
});
const assets = await this.assetRepository.getRandom([auth.user.id, ...partnerIds], count);
return assets.map((a) => mapAsset(a, { auth }));
}