fix: lỗi bong bóng Tour vẫn hiển thị sau khi xóa
This commit is contained in:
Vendored
+3
-1
@@ -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;
|
||||||
|
|||||||
Vendored
+1
-1
File diff suppressed because one or more lines are too long
+3
-1
@@ -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
|
||||||
|
|||||||
@@ -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`;
|
||||||
|
|||||||
Reference in New Issue
Block a user