dashboard design and functionality and data and page doctor and clinic change data
This commit is contained in:
@@ -1,6 +1,5 @@
|
||||
import axios from "axios";
|
||||
import BlogPage from "@/components/blog";
|
||||
import articles from "@/data/articles.json";
|
||||
import Layout from "@/components/layout/StLayout";
|
||||
|
||||
async function Blog({ params: { slug } }) {
|
||||
@@ -11,7 +10,6 @@ async function Blog({ params: { slug } }) {
|
||||
|
||||
const resBlog = blog.data;
|
||||
const resBlogs = blogs.data;
|
||||
console.log(resBlogs);
|
||||
|
||||
return (
|
||||
<Layout>
|
||||
|
||||
@@ -20,7 +20,7 @@ function EditField({
|
||||
<TextField
|
||||
{...props}
|
||||
rows={multiline}
|
||||
value={data?.value}
|
||||
value={data?.value || ""}
|
||||
multiline={multiline}
|
||||
type={type || "text"}
|
||||
placeholder={placeholder || ""}
|
||||
|
||||
@@ -17,7 +17,7 @@ function AutoSelector({
|
||||
disablePortal
|
||||
options={list}
|
||||
disabled={disabled}
|
||||
defaultValue={value}
|
||||
defaultValue={value || ""}
|
||||
ListboxProps={listboxProps}
|
||||
getOptionLabel={(option) => {
|
||||
if (typeof option === "string") return option;
|
||||
|
||||
+13
-1
@@ -2,6 +2,7 @@ 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, headers } from "next/headers";
|
||||
import { redirect } from "next/navigation";
|
||||
|
||||
@@ -11,6 +12,16 @@ export default async function Dashboard() {
|
||||
const ability = defineAbilitiesFor(user);
|
||||
const cookieStore = cookies();
|
||||
const token = cookieStore.get("access_token");
|
||||
const uuid = "9ef7c050-6e81-4aa2-8248-283a16635624";
|
||||
const response = await axios.get(
|
||||
`https://back-dev.clinic-pro.ir/api/v1/user-profile/9ef7c050-6e81-4aa2-8248-283a16635624`,
|
||||
{
|
||||
headers: {
|
||||
Authorization: `Bearer ${token.value}`,
|
||||
},
|
||||
}
|
||||
);
|
||||
const dashboard = response.data;
|
||||
|
||||
if (!ability.can("access", "Dashboard")) {
|
||||
return redirect("/");
|
||||
@@ -21,8 +32,9 @@ export default async function Dashboard() {
|
||||
|
||||
return (
|
||||
<Content
|
||||
matchedCity={matchedCity}
|
||||
logged={token}
|
||||
dataUser={dashboard}
|
||||
matchedCity={matchedCity}
|
||||
initialTurnsDetails={isMobile}
|
||||
/>
|
||||
);
|
||||
|
||||
Reference in New Issue
Block a user