Skip to content

Commit

Permalink
next js version changed
Browse files Browse the repository at this point in the history
  • Loading branch information
ampodo committed Oct 24, 2023
1 parent fa6055f commit f0995ae
Show file tree
Hide file tree
Showing 5 changed files with 56 additions and 54 deletions.
92 changes: 48 additions & 44 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
"mongodb": "^6.0.0",
"mongoose": "^7.5.0",
"multer": "^1.4.5-lts.1",
"next": "13.4.19",
"next": "^13.4.9",
"nodemailer": "^6.9.4",
"postcss": "8.4.28",
"prop-types": "^15.8.1",
Expand Down
12 changes: 5 additions & 7 deletions src/app/page.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,20 +12,18 @@ export async function getCars() {
Cookie: `token=${token}`,
},
});
return response.data.data || [];
return response.data.data;
} catch (error) {
console.error("Error fetching cars:", error);
return [];
throw error;
}
}

export default async function Home() {

const cars = await getCars();
const cars = await getCars();

return (
<div className="mt-12 ml-8 mr-8">
<CarsGrid cars={cars} />
</div>
<CarsGrid cars={cars} />
</div>
);
}
2 changes: 1 addition & 1 deletion src/components/Footer.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ export function SimpleFooter() {
return (
<footer className="bg-white bg-opacity-80 flex w-full flex-row flex-wrap items-center justify-center gap-y-6 gap-x-12 border-t py-16 text-center md:justify-between my-6 mb-0">
<Typography color="blue-gray" className="font-normal ml-4">
&copy; {currentYear} Car Rental app
&copy; {currentYear} Car Rentals app
</Typography>
</footer>
);
Expand Down
2 changes: 1 addition & 1 deletion src/components/homeComponents/CarsGrid.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
import React from "react";
import { useRouter } from "next/navigation";

function CarsGrid({ cars = [] }) {
function CarsGrid({cars}) {

const router = useRouter();

Expand Down

0 comments on commit f0995ae

Please sign in to comment.