Portofolio

#feat
- Create porto
- Edit Porto
- Upload gambar background profile
- List user
- Search user
## No issuue
This commit is contained in:
2024-01-19 14:16:16 +08:00
parent 01da30bdb5
commit 5f4337333a
175 changed files with 3451 additions and 1017 deletions

View File

@@ -1,9 +1,10 @@
import { User_getUserId } from "@/app_modules/fun_global/get_user_token";
import { CreateProfile } from "@/app_modules/katalog/profile";
export default async function Page({params}: {params: {id: string}}) {
// console.log(params.id)
const userId = await User_getUserId()
return <>
<CreateProfile userId={params.id}/>
<CreateProfile userId={userId}/>
</>
}

View File

@@ -1,4 +1,4 @@
import { funGetUserProfile } from "@/app_modules/fun/get_user_profile";
import { funGetUserProfile } from "@/app_modules/fun_global/get_user_profile";
import { EditProfileLayout } from "@/app_modules/katalog/profile";
export default async function Layout({ children, params }: { children: any, params: {id: string} }) {

View File

@@ -1,14 +1,16 @@
import { funGetUserProfile } from "@/app_modules/fun/get_user_profile";
import { getProfile } from "@/app_modules/katalog/profile";
import { funGetUserProfile } from "@/app_modules/fun_global/get_user_profile";
import EditProfile from "@/app_modules/katalog/profile/edit/view";
import { Profile_getOneProfileAndUserById } from "@/app_modules/katalog/profile/fun/get/get_one_user_profile";
export default async function Page({ params }: { params: { id: string } }) {
let profileId = params.id
const data = await funGetUserProfile(params.id);
const dataProfile = await Profile_getOneProfileAndUserById(profileId)
return (
<>
{/* {JSON.stringify(data)} */}
<EditProfile data={data as any} />
<EditProfile data={dataProfile as any} />
</>
);
}

View File

@@ -1,13 +0,0 @@
import { UploadFotoProfileLayout } from "@/app_modules/katalog/profile";
import { AppShell } from "@mantine/core";
export default function Layout({ children, params }: { children: any, params: {id: string} }) {
return (
<>
<UploadFotoProfileLayout profileId={params.id}>{children}</UploadFotoProfileLayout>
</>
);
}

View File

@@ -1,26 +0,0 @@
import { UploadFotoProfile } from "@/app_modules/katalog/profile";
import { unsealData } from "iron-session";
import { cookies } from "next/headers";
import yaml from "yaml";
import fs from "fs";
import { funGetUserProfile } from "@/app_modules/fun/get_user_profile";
const config = yaml.parse(fs.readFileSync("config.yaml").toString());
export default async function Page() {
const c = cookies().get("ssn");
const usr = JSON.parse(
await unsealData(c?.value as string, {
password: config.server.password,
})
);
const imageUrl = await funGetUserProfile(usr.id).then(
(res) => res?.Profile?.ImageProfile?.url
);
return (
<>
<UploadFotoProfile imageUrl={imageUrl} />
</>
);
}

View File

@@ -0,0 +1,8 @@
import LayoutProfile_UpdateFotoBackground from "@/app_modules/katalog/profile/upload/foto_background/layout";
import React from "react";
export default async function Layout({children}: {children: React.ReactNode}) {
return<>
<LayoutProfile_UpdateFotoBackground>{children}</LayoutProfile_UpdateFotoBackground>
</>
}

View File

@@ -0,0 +1,12 @@
import { Profile_getOneById } from "@/app_modules/katalog/profile/fun/get/get_one_profile"
import Profile_UpdateFotoBackground from "@/app_modules/katalog/profile/upload/foto_background"
export default async function Page({params}:{params: {id: string}}) {
let profileId = params.id
const dataProfile = await Profile_getOneById(profileId)
return <>
<Profile_UpdateFotoBackground dataProfile={dataProfile as any}/>
</>
}

View File

@@ -0,0 +1,9 @@
import { UploadFotoProfileLayout } from "@/app_modules/katalog/profile";
import React from "react";
export default async function Layout({children, params}: {children: React.ReactNode, params: {id: string}}) {
let profileId = params.id
return <>
<UploadFotoProfileLayout profileId={profileId} >{children}</UploadFotoProfileLayout>
</>
}

View File

@@ -0,0 +1,11 @@
import { UploadFotoProfile } from "@/app_modules/katalog/profile";
import { Profile_getOneById } from "@/app_modules/katalog/profile/fun/get/get_one_profile";
export default async function Page({params}: {params: {id: string}}) {
let profileId = params.id
const dataProfile = await Profile_getOneById(profileId)
return <>
<UploadFotoProfile dataProfile={dataProfile as any}/>
</>
}