Add profile form

This commit is contained in:
anime committed 2024-09-23 19:35:57 +06:00
1 parent f7a1bef554
commit e3b73d38c0
4 files changed
+189 -3

No files matched your search

+9 -2
View File
@@ -4,12 +4,14 @@ import ProfileAvatar from "@/features/ProfileAvatar/ProfileAvatar";
import { apiInstance } from "@/shared/config/apiConfig";
import { authConfig } from "@/shared/config/authConfig";
import { IProfile } from "@/shared/types/profile-type";
import ProfileForm from "@/widgets/forms/ProfileForm/ProfileForm";
import { AxiosError } from "axios";
import { getServerSession } from "next-auth";
import React from "react";
const Personal = async () => {
const session = await getServerSession(authConfig);
console.log(session?.access_token);
const getProfile = async () => {
const Authorization = `Bearer ${session?.access_token}`;
const config = {
@@ -22,7 +24,6 @@ const Personal = async () => {
"/users/profile/",
config
);
return response.data;
} catch (error: unknown) {
if (error instanceof AxiosError) console.log(error.message);
@@ -33,7 +34,13 @@ const Personal = async () => {
return (
<div className="personal">
<ProfileAvatar img={data?.image as string} />
{/* <ProfileAvatar img={data?.image as string} /> */}
<ProfileForm
id={data?.id as number}
first_name={data?.first_name as string}
last_name={data?.last_name as string}
email={data?.email as string}
/>
</div>
);
};