Skip to content

Commit

Permalink
Fix createManyAndReturn not available in production
Browse files Browse the repository at this point in the history
  • Loading branch information
paulbert committed Jun 27, 2024
1 parent a5d8658 commit 3812714
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion apps/server/src/app/videos/videos.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -32,10 +32,13 @@ export class VideosService {
seasonId,
order: index + maxOrder + 1,
}));
return await this.prismaService.video.createManyAndReturn({
await this.prismaService.video.createMany({
data,
skipDuplicates: true,
});
return this.prismaService.video.findMany({
where: { id: { in: videos.map(({ videoId }) => videoId) } },
});
}

async updateVideosSeason(videoIds: string[], seasonId: number) {
Expand Down

0 comments on commit 3812714

Please sign in to comment.