change response file & request get user-profile & change design dashboard page & handle limit page dashboard

This commit is contained in:
Ehsan
2025-05-31 03:35:23 +03:30
parent 0969eca274
commit 80c74361eb
38 changed files with 233 additions and 121 deletions
+8 -3
View File
@@ -2,18 +2,23 @@ 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 { redirect } from "next/navigation";
async function UserAccount() {
export default async function Dashboard() {
const { matchedCity } = getStateInfo();
const user = await getUser();
const ability = defineAbilitiesFor(user);
const response = await axios.get(
"https://back-dev.clinic-pro.ir/api/v1/user-profile/e4fd81b4-31bc-4f9a-b300-da23026f9d79"
);
console.log(response);
if (!ability.can("access", "Dashboard")) {
return redirect("/");
}
return <Content matchedCity={matchedCity} />;
}
export default UserAccount;