Skip to content

Commit

Permalink
Remove commented out code for registering visit in RootLayout
Browse files Browse the repository at this point in the history
  • Loading branch information
ali-josheghani committed Sep 17, 2024
1 parent badac91 commit ac75fc1
Showing 1 changed file with 18 additions and 18 deletions.
36 changes: 18 additions & 18 deletions src/app/(main)/layout.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,27 +6,27 @@ import SwitchHeader from "@/components/templates/SwitchHeader";
import ShowFooter from "@/components/templates/ShowFooter";

export default function RootLayout({ children }) {
try {
const registerVisit = async () => {
const response = await fetch("/https://auth.salamlang.ir/api/visit", {
method: "GET",
headers: {
"Content-Type": "application/json",
},
});
// try {
// const registerVisit = async () => {
// const response = await fetch("/https://auth.salamlang.ir/api/visit", {
// method: "GET",
// headers: {
// "Content-Type": "application/json",
// },
// });

if (!response.ok) {
throw new Error("Failed to register visit");
}
// if (!response.ok) {
// throw new Error("Failed to register visit");
// }

const data = await response.json();
console.log("Visit registered:", data);
};
// const data = await response.json();
// console.log("Visit registered:", data);
// };

registerVisit();
} catch (error) {
console.error("Error registering visit:", error);
}
// registerVisit();
// } catch (error) {
// console.error("Error registering visit:", error);
// }
return (
<html lang="fa" dir="rtl">
<body>
Expand Down

0 comments on commit ac75fc1

Please sign in to comment.