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,34 +1,29 @@
import prisma from "@/app/lib/prisma";
import { getProfile } from "@/app_modules/katalog/profile";
import { KatalogView } from "@/app_modules/katalog/main";
import { url } from "inspector";
import { unsealData } from "iron-session";
import _ from "lodash";
import { cookies } from "next/headers";
import { redirect } from "next/navigation";
import { funGetUserProfile } from "@/app_modules/fun/get_user_profile";
import { funGetUserProfile } from "@/app_modules/fun_global/get_user_profile";
import yaml from "yaml";
import fs from "fs";
import { funGetListPortofolio } from "@/app_modules/katalog/portofolio/fun/get_list_portofolio";
import { funGetListPortofolio } from "@/app_modules/katalog/portofolio/fun/get/get_list_portofolio";
import { User_getUserId } from "@/app_modules/fun_global/get_user_token";
import { Profile_getOneById } from "@/app_modules/katalog/profile/fun/get/get_one_profile";
import { Profile_getOneProfileAndUserById } from "@/app_modules/katalog/profile/fun/get/get_one_user_profile";
const config = yaml.parse(fs.readFileSync("config.yaml").toString());
export default async function Page() {
const data = await getProfile();
const u = cookies().get("ssn");
const usr = JSON.parse(
await unsealData(u?.value as string, {
password: config.server.password,
})
);
const user = await funGetUserProfile(usr.id);
const listPorto = await funGetListPortofolio(user?.Profile?.id)
export default async function Page({ params }: { params: { id: string } }) {
let profileId = params.id;
const userLoginId = await User_getUserId()
const listPorto = await funGetListPortofolio(profileId);
const dataProfile = await Profile_getOneProfileAndUserById(profileId)
// console.log(dataProfile)
return (
<>
<KatalogView user={user as any} listPorto={listPorto as any} />
<KatalogView profile={dataProfile as any} listPorto={listPorto as any} userLoginId={userLoginId} />
</>
);
}