handle limit page dashboard & change header profile user & get data from api in page clinics & clinic item and doctor item

This commit is contained in:
Ehsan
2025-06-01 01:08:25 +03:30
parent 80c74361eb
commit e292176a61
45 changed files with 223 additions and 258 deletions
+8 -6
View File
@@ -2,23 +2,25 @@ import Content from "@/components/dashboard/Content";
import { defineAbilitiesFor } from "@/lib/ability";
import { getUser } from "@/lib/auth";
import { getStateInfo } from "@/lib/getStateInfo";
import axios from "axios";
import { cookies } from "next/headers";
import { redirect } from "next/navigation";
export default async function Dashboard() {
const { matchedCity } = getStateInfo();
const user = await getUser();
const ability = defineAbilitiesFor(user);
const cookieStore = cookies();
const token = cookieStore.get("access_token");
const response = await axios.get(
"https://back-dev.clinic-pro.ir/api/v1/user-profile/e4fd81b4-31bc-4f9a-b300-da23026f9d79"
);
// const response = await axios.get(
// "https://back-dev.clinic-pro.ir/api/v1/user-profile/e4fd81b4-31bc-4f9a-b300-da23026f9d79"
// );
console.log(response);
// console.log(response);
if (!ability.can("access", "Dashboard")) {
return redirect("/");
}
return <Content matchedCity={matchedCity} />;
return <Content matchedCity={matchedCity} logged={token} />;
}