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",
},
});
}