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:
2026-06-17 19:46:55 +07:00
parent 2afb2971da
commit b6551da147
5 changed files with 23 additions and 12 deletions
+5 -1
View File
@@ -108,7 +108,9 @@ export const AddLocationModal = ({ isOpen, onClose, tourId, initialLegId, editin
expenseDescription: expense?.description || '',
expenseNote: expense?.note || '',
paidById: expense?.paidById || '',
plannedStart: editingLocation.plannedStart ? editingLocation.plannedStart.slice(0, 16) : '',
plannedStart: isStartPoint
? (editingLocation.plannedEnd ? editingLocation.plannedEnd.slice(0, 16) : '')
: (editingLocation.plannedStart ? editingLocation.plannedStart.slice(0, 16) : ''),
plannedEnd: editingLocation.plannedEnd ? editingLocation.plannedEnd.slice(0, 16) : ''
});
} else {
@@ -291,12 +293,14 @@ export const AddLocationModal = ({ isOpen, onClose, tourId, initialLegId, editin
name: formData.name || "Điểm xuất phát",
latitude: parseFloat(formData.latitude as any),
longitude: parseFloat(formData.longitude as any),
plannedEnd: formData.plannedStart,
});
} else if (isEndPoint) {
await updateTourEndPoint(tourId, {
name: formData.name || "Điểm kết thúc",
latitude: parseFloat(formData.latitude as any),
longitude: parseFloat(formData.longitude as any),
plannedStart: formData.plannedStart,
});
} else {
const payload: any = {