Skip to content

Commit

Permalink
Update page.js
Browse files Browse the repository at this point in the history
  • Loading branch information
ElyasMehraein committed Apr 30, 2024
1 parent c64ac1f commit 0b7bf89
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions app/all/page.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,20 +4,20 @@ import dynamic from 'next/dynamic'
const AllBusinesses = dynamic(() => import("@/components/templates/allBusinesses/AllBusinesses"))

const page = async function () {
try {
await connectToDB();
const businesses = JSON.parse(JSON.stringify(await BusinessModel.find({}, "businessName bio businessBrand isAvatar")));
const businesses = JSON.parse(JSON.stringify(await BusinessModel.find({},
"businessName bio businessBrand isAvatar").catch(err => {
console.error(err);
})));


return (
<AllBusinesses businesses={businesses} />
// <h1 className="inMiddle">تست</h1>

);
} catch (err) {

console.error('Error fetching businesses:', err);
}

}

export default page

0 comments on commit 0b7bf89

Please sign in to comment.