Fix: Db Profile

Deskripsi:
- Menghapus field imagesId dan imagesBackgroundId
- Menhapus table backgroundImage
- Menghapus component avatar dan header card yang lama
## No Issue
This commit is contained in:
2024-10-03 15:09:38 +08:00
parent ca99de7dd5
commit cf9355e91f
46 changed files with 81 additions and 1060 deletions

View File

@@ -1,32 +0,0 @@
import prisma from "@/app/lib/prisma";
import fs from "fs";
import { NextRequest, NextResponse } from "next/server";
export async function GET(
req: NextRequest,
{ params }: { params: { id: string } }
) {
const get = await prisma.imagesBackground.findUnique({
where: {
id: params.id,
},
select: {
url: true,
},
});
if (!fs.existsSync(`./public/profile/background/${get?.url}`)) {
const notFile = fs.readFileSync("./public/aset/global/no_img.png");
return new NextResponse(notFile, {
headers: {
"Content-Type": "image/png",
},
});
}
const file = fs.readFileSync(`./public/profile/background/${get?.url}`);
return new NextResponse(file, {
headers: {
"Content-Type": "image/png",
},
});
}

View File

@@ -1,10 +1,8 @@
import { Admin_KonfirmasiInvestasi } from "@/app_modules/admin/investasi";
import { funGetUserProfile } from "@/app_modules/fun_global/get_user_profile";
import getOneInvestasiById from "@/app_modules/investasi/fun/get_one_investasi_by_id";
export default async function Page({ params }: { params: { id: string } }) {
const dataInvestasi = await getOneInvestasiById(params.id);
const dataUser = await funGetUserProfile(dataInvestasi?.authorId as any);
// console.log(dataUser)
return (

View File

@@ -1,8 +0,0 @@
import { LayoutForum_Komentar } from "@/app_modules/forum";
import React from "react";
export default async function Layout({children}: {children: React.ReactNode}) {
return<>
<LayoutForum_Komentar>{children}</LayoutForum_Komentar>
</>
}

View File

@@ -1,9 +0,0 @@
import ComponentGlobal_V2_LoadingPage from "@/app_modules/_global/loading_page_v2";
export default async function Page() {
return (
<>
<ComponentGlobal_V2_LoadingPage />
</>
);
}

View File

@@ -1,19 +0,0 @@
import { funGetUserIdByToken } from "@/app_modules/_global/fun/get";
import { Forum_Komentar } from "@/app_modules/forum";
import { forum_getOnePostingById } from "@/app_modules/forum/fun/get/get_one_posting_by_id";
export default async function Page({ params }: { params: { id: string } }) {
let postingId = params.id;
const dataPosting = await forum_getOnePostingById(postingId);
const userLoginId = await funGetUserIdByToken();
return (
<>
<Forum_Komentar
dataPosting={dataPosting as any}
userLoginId={userLoginId}
/>
</>
);
}

View File

@@ -1,4 +1,3 @@
import { funGetUserProfile } from "@/app_modules/fun_global/get_user_profile";
import { EditProfileLayout } from "@/app_modules/katalog/profile";
export default async function Layout({
@@ -8,8 +7,6 @@ export default async function Layout({
children: any;
params: { id: string };
}) {
let profileId = params.id;
return (
<>
<EditProfileLayout>{children}</EditProfileLayout>

View File

@@ -1,10 +1,9 @@
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 (