Skip to content

Commit

Permalink
Merge branch 'main' into develop
Browse files Browse the repository at this point in the history
  • Loading branch information
SelenatorXo authored Oct 23, 2024
2 parents 0e5456d + 988975c commit 71a4357
Show file tree
Hide file tree
Showing 2 changed files with 643 additions and 5 deletions.
30 changes: 25 additions & 5 deletions ai-trip-creator/src/components/dashboard/ItineraryForm.js
Original file line number Diff line number Diff line change
Expand Up @@ -413,12 +413,31 @@ function ItineraryForm() {
// //console.log("End Location:", endLocation);
// };

const addEndLocation = () => {
// Check and add startLocation if it's not already in Locations
if (startLocation !== "" && !Locations.includes(startLocation)) {
setLocations((prevLocations) => [...prevLocations, startLocation]);
}
// const addEndLocation = () => {
// // Check and add startLocation if it's not already in Locations
// /*if (startLocation !== "" && !Locations.includes(startLocation)) {
// setLocations((prevLocations) => [...prevLocations, startLocation]);
// }*/

// if (startLocation !== "" && !Locations.includes(startLocation)) {
// setLocations((prevStartLocations) => [
// ...prevStartLocations,
// startLocation,
// ]);
// }

// // Check and add endLocation if it's not already in Locations
// if (endLocation !== "" && !Locations.includes(endLocation)) {
// setLocations((prevLocations) => [...prevLocations, endLocation]);
// }

// // Check and add tripDays if it's not already in Lengths
// if (tripDays !== "" && !Lengths.includes(tripDays)) {
// setLengths((prevLengths) => [...prevLengths, tripDays]);
// }
// };

const addEndLocation = () => {
// Check and add endLocation if it's not already in Locations
if (endLocation !== "" && !Locations.includes(endLocation)) {
setLocations((prevLocations) => [...prevLocations, endLocation]);
Expand All @@ -430,6 +449,7 @@ function ItineraryForm() {
}
};



// Use useEffect to log the updated locations whenever it changes
useEffect(() => {
Expand Down
Loading

0 comments on commit 71a4357

Please sign in to comment.