-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
0beb6b5
commit 8bb2a53
Showing
2 changed files
with
17 additions
and
14 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,23 +1,21 @@ | ||
// import connectToDB from "@/configs/db"; | ||
// import BusinessModel from "@/models/Business"; | ||
// import AllBusinesses from "@/components/templates/allBusinesses/AllBusinesses"; | ||
import CreateBusiness from "@/components/templates/createBusiness/CreateBusiness"; | ||
import connectToDB from "@/configs/db"; | ||
import BusinessModel from "@/models/Business"; | ||
import AllBusinesses from "@/components/templates/allBusinesses/AllBusinesses"; | ||
|
||
export default async function page() { | ||
// try { | ||
// await connectToDB(); | ||
// const businesses = JSON.parse(JSON.stringify(await BusinessModel.find({}, "businessName bio businessBrand isAvatar"))); | ||
try { | ||
await connectToDB(); | ||
const businesses = JSON.parse(JSON.stringify(await BusinessModel.find({}, "businessName bio businessBrand isAvatar"))); | ||
|
||
|
||
return ( | ||
// <AllBusinesses businesses={businesses} /> | ||
<AllBusinesses businesses={businesses} /> | ||
// <h1 className="inMiddle">تست</h1> | ||
<CreateBusiness /> | ||
|
||
); | ||
// } catch (err) { | ||
} catch (err) { | ||
|
||
// console.error('Error fetching businesses:', err); | ||
// } | ||
console.error('Error fetching businesses:', err); | ||
} | ||
} | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters