## Deskripsi:
- Perubahan tampilan notifikasi
- Pin map sesuai logo
- Pin map bisa custom
### No Issue
This commit is contained in:
2024-08-23 14:15:11 +08:00
parent cae318c5e3
commit a6bb993b0d
75 changed files with 1602 additions and 646 deletions

View File

@@ -0,0 +1,32 @@
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.images.findUnique({
where: {
id: params.id,
},
select: {
url: true,
},
});
if (!fs.existsSync(`./public/map/foto/${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/map/foto/${get?.url}`);
return new NextResponse(file, {
headers: {
"Content-Type": "image/png",
},
});
}

View File

@@ -15,7 +15,7 @@ export async function GET(
},
});
if (!fs.existsSync(`./public/map/${get?.url}`)) {
if (!fs.existsSync(`./public/map/pin/${get?.url}`)) {
const notFile = fs.readFileSync("./public/aset/global/no_img.png");
return new NextResponse(notFile, {
headers: {
@@ -23,7 +23,7 @@ export async function GET(
},
});
}
const file = fs.readFileSync(`./public/map/${get?.url}`);
const file = fs.readFileSync(`./public/map/pin/${get?.url}`);
return new NextResponse(file, {
headers: {
"Content-Type": "image/png",