Skip to content

Commit

Permalink
Merge pull request #1 from mohdjami/fix
Browse files Browse the repository at this point in the history
Fixed some changes
  • Loading branch information
mohdjami authored Dec 25, 2024
2 parents 528fc2b + f171f1f commit bf73a3d
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 2 deletions.
2 changes: 1 addition & 1 deletion app/itinerary/[id]/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ const page = async ({
.single();
return (
<div>
<ItineraryDisplay itinerary={data.response.itinerary} />
<ItineraryDisplay id={+params.id} itinerary={data.response.itinerary} />
</div>
);
};
Expand Down
2 changes: 1 addition & 1 deletion app/itinerary/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ export default async function Home() {
const credits = await getUserCredits(user?.id);

if (!credits) {
return <ItineraryHome initialCredits={5} />;
return <ItineraryHome initialCredits={0} />;
}
return <ItineraryHome initialCredits={credits} />;
}
1 change: 1 addition & 0 deletions components/forms/travel-form.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -363,6 +363,7 @@ export default function TravelItineraryForm({
>
<div className="w-full max-w-7xl">
<ItineraryDisplay
id={itineraryKey}
key={itineraryKey}
name={name}
itinerary={data.itinerary}
Expand Down
1 change: 1 addition & 0 deletions components/itinerary-page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import { useState } from "react";
import TravelItineraryForm from "./forms/travel-form";
const ItineraryHome = ({ initialCredits }: { initialCredits: number }) => {
const [credits, setCredits] = useState(initialCredits);

return (
<TravelItineraryForm initialCredits={credits} setCredits={setCredits} />
);
Expand Down

0 comments on commit bf73a3d

Please sign in to comment.