change response file & request get user-profile & change design dashboard page & handle limit page dashboard
This commit is contained in:
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user