change fields component & handle edit, delete, add data and save & change functional page doctor
This commit is contained in:
@@ -13,33 +13,17 @@ export default async function Dashboard({ searchParams }) {
|
||||
const ability = defineAbilitiesFor(user);
|
||||
const cookieStore = cookies();
|
||||
const token = cookieStore.get("access_token");
|
||||
const userInfo = cookieStore.get("userInfo");
|
||||
|
||||
if (!ability.can("access", "Dashboard")) {
|
||||
removeToken();
|
||||
return redirect("/login");
|
||||
}
|
||||
|
||||
const response = await fetchReq(
|
||||
`https://back-dev.clinic-pro.ir/api/v1/user-profile/${JSON.parse(userInfo?.value).uuid}`,
|
||||
{
|
||||
headers: {
|
||||
Authorization: `Bearer ${token.value}`,
|
||||
},
|
||||
}
|
||||
);
|
||||
|
||||
const userAgent = headers().get("user-agent") || "";
|
||||
const isMobile = /Mobi|Android/i.test(userAgent);
|
||||
|
||||
return (
|
||||
<Content
|
||||
dataUser={response}
|
||||
logged={token.value}
|
||||
params={searchParams}
|
||||
matchedCity={matchedCity}
|
||||
initialTurnsDetails={isMobile}
|
||||
userInfo={JSON.parse(userInfo.value || {})}
|
||||
/>
|
||||
);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user