fix: lỗi bong bóng Tour vẫn hiển thị sau khi xóa

This commit is contained in:
2026-06-17 17:15:11 +07:00
parent 4d63bff214
commit 05dc80bb6d
4 changed files with 8 additions and 4 deletions
+3 -1
View File
@@ -344,7 +344,7 @@ let TourController = class TourController {
} }
async createTour(body, req) { async createTour(body, req) {
const { title, description, startDate, endDate, adultCount, childCount, childDiscount, tags } = body; const { title, description, startDate, endDate, adultCount, childCount, childDiscount, tags } = body;
return this.prisma.tour.create({ const tour = await this.prisma.tour.create({
data: { data: {
title, title,
description, description,
@@ -374,6 +374,8 @@ let TourController = class TourController {
} }
} }
}); });
await this.cacheManager.del(`/api/v1/tours/explore`);
return tour;
} }
async addLocation(tourId, body, req) { async addLocation(tourId, body, req) {
const legId = body.legId; const legId = body.legId;
+1 -1
View File
File diff suppressed because one or more lines are too long
+3 -1
View File
@@ -308,7 +308,7 @@ class TourController {
@Post() @Post()
async createTour(@Body() body: any, @Req() req: any) { async createTour(@Body() body: any, @Req() req: any) {
const { title, description, startDate, endDate, adultCount, childCount, childDiscount, tags } = body; const { title, description, startDate, endDate, adultCount, childCount, childDiscount, tags } = body;
return this.prisma.tour.create({ const tour = await this.prisma.tour.create({
data: { data: {
title, title,
description, description,
@@ -338,6 +338,8 @@ class TourController {
} }
} }
}); });
await this.cacheManager.del(`/api/v1/tours/explore`);
return tour;
} }
@Roles(ParticipantRole.OWNER, ParticipantRole.MANAGER, ParticipantRole.MEMBER) // Allow members to add locations @Roles(ParticipantRole.OWNER, ParticipantRole.MANAGER, ParticipantRole.MEMBER) // Allow members to add locations
+1 -1
View File
@@ -383,7 +383,7 @@ export const ExploreMap = ({ onBack, onLogout, user, onViewTour, onOpenMyPhotos
{/* Tự động di chuyển bản đồ đến vị trí người dùng khi tìm thấy tọa độ */} {/* Tự động di chuyển bản đồ đến vị trí người dùng khi tìm thấy tọa độ */}
<RecenterMap position={userPos} /> <RecenterMap position={userPos} />
<MarkerClusterGroup chunkedLoading> <MarkerClusterGroup key={`cluster-${filteredTours.length}`} chunkedLoading>
{filteredTours.map((tour) => { {filteredTours.map((tour) => {
const startLoc = tour.legs?.[0]?.locations?.[0]; const startLoc = tour.legs?.[0]?.locations?.[0];
const tourImage = tour.photos?.[0]?.imageUrl || `https://picsum.photos/seed/${tour.id}/200/200`; const tourImage = tour.photos?.[0]?.imageUrl || `https://picsum.photos/seed/${tour.id}/200/200`;