Thêm tính năng click chuột phải vào bong bóng để lấy link chia sẻ

This commit is contained in:
2026-06-16 08:46:45 +07:00
parent b939fc959d
commit 02c493f7e0
5 changed files with 159 additions and 5 deletions
+29
View File
@@ -372,6 +372,35 @@ class TourController {
});
}
@Get(':id/public')
async getPublicTourDetails(@Param('id', ParseUUIDPipe) id: string) {
const tour = await this.prisma.tour.findUnique({
where: { id },
include: {
participants: {
include: {
user: {
select: { id: true, name: true, email: true }
}
}
},
photos: true,
legs: {
orderBy: { sequence: 'asc' },
include: {
locations: {
orderBy: { plannedStart: 'asc' },
include: { _count: { select: { comments: true } } }
},
},
},
},
});
if (!tour) throw new NotFoundException(`Không tìm thấy Tour`);
return tour;
}
@UseGuards(JwtAuthGuard, TourRoleGuard)
@Get(':id')
async getTourDetails(@Param('id', ParseUUIDPipe) id: string) {