fix: sửa lại cho phép chỉnh sửa thời gian bắt đầu và kết thúc của điểm xuất phát và điểm kết thúc
This commit is contained in:
Vendored
+4
-2
@@ -419,7 +419,7 @@ let TourController = class TourController {
|
||||
});
|
||||
}
|
||||
async updateTourStartPoint(tourId, body, req) {
|
||||
const { latitude, longitude, name } = body;
|
||||
const { latitude, longitude, name, plannedEnd } = body;
|
||||
console.log(`[USER ACTION] User ${req.user.id} set START point for Tour ${tourId}: "${name}" at [${latitude}, ${longitude}]`);
|
||||
await this.prisma.location.deleteMany({
|
||||
where: {
|
||||
@@ -441,6 +441,7 @@ let TourController = class TourController {
|
||||
type: 'MOVE',
|
||||
legId: firstLeg.id,
|
||||
plannedStart: new Date(0),
|
||||
plannedEnd: plannedEnd ? new Date(plannedEnd) : null,
|
||||
}
|
||||
}).then(async (loc) => {
|
||||
await Promise.all([
|
||||
@@ -452,7 +453,7 @@ let TourController = class TourController {
|
||||
});
|
||||
}
|
||||
async updateTourEndPoint(tourId, body, req) {
|
||||
const { latitude, longitude, name } = body;
|
||||
const { latitude, longitude, name, plannedStart } = body;
|
||||
console.log(`[USER ACTION] User ${req.user.id} set END point for Tour ${tourId}: "${name}" at [${latitude}, ${longitude}]`);
|
||||
await this.prisma.location.deleteMany({
|
||||
where: {
|
||||
@@ -473,6 +474,7 @@ let TourController = class TourController {
|
||||
longitude,
|
||||
type: 'MOVE',
|
||||
legId: lastLeg.id,
|
||||
plannedStart: plannedStart ? new Date(plannedStart) : null,
|
||||
plannedEnd: new Date(0),
|
||||
}
|
||||
}).then(async (loc) => {
|
||||
|
||||
Vendored
+1
-1
File diff suppressed because one or more lines are too long
+4
-2
@@ -396,7 +396,7 @@ class TourController {
|
||||
@UseGuards(JwtAuthGuard, TourRoleGuard)
|
||||
@Post(':tourId/start-point')
|
||||
async updateTourStartPoint(@Param('tourId', ParseUUIDPipe) tourId: string, @Body() body: any, @Req() req: any) {
|
||||
const { latitude, longitude, name } = body;
|
||||
const { latitude, longitude, name, plannedEnd } = body;
|
||||
|
||||
console.log(`[USER ACTION] User ${req.user.id} set START point for Tour ${tourId}: "${name}" at [${latitude}, ${longitude}]`);
|
||||
|
||||
@@ -426,6 +426,7 @@ class TourController {
|
||||
type: 'MOVE',
|
||||
legId: firstLeg.id,
|
||||
plannedStart: new Date(0),
|
||||
plannedEnd: plannedEnd ? new Date(plannedEnd) : null,
|
||||
}
|
||||
}).then(async (loc) => {
|
||||
await Promise.all([
|
||||
@@ -441,7 +442,7 @@ class TourController {
|
||||
@UseGuards(JwtAuthGuard, TourRoleGuard)
|
||||
@Post(':tourId/end-point')
|
||||
async updateTourEndPoint(@Param('tourId', ParseUUIDPipe) tourId: string, @Body() body: any, @Req() req: any) {
|
||||
const { latitude, longitude, name } = body;
|
||||
const { latitude, longitude, name, plannedStart } = body;
|
||||
|
||||
console.log(`[USER ACTION] User ${req.user.id} set END point for Tour ${tourId}: "${name}" at [${latitude}, ${longitude}]`);
|
||||
|
||||
@@ -468,6 +469,7 @@ class TourController {
|
||||
longitude,
|
||||
type: 'MOVE',
|
||||
legId: lastLeg.id,
|
||||
plannedStart: plannedStart ? new Date(plannedStart) : null,
|
||||
plannedEnd: new Date(0), // Đánh dấu đây là điểm kết thúc đặc biệt
|
||||
}
|
||||
}).then(async (loc) => {
|
||||
|
||||
Reference in New Issue
Block a user