Seeder data Landing Page - Desa

This commit is contained in:
2026-01-12 14:03:44 +08:00
parent 503da91ce6
commit 903dc74cca
26 changed files with 1898 additions and 351 deletions

View File

@@ -0,0 +1,25 @@
import prisma from "@/lib/prisma";
// Ganti nama fungsi dan logikanya
export default async function resolveImageById(
imageId?: string | null
): Promise<string | null> {
if (!imageId) return null;
const image = await prisma.fileStorage.findFirst({
where: {
id: imageId, // ← cari berdasarkan ID
category: "image",
isActive: true,
deletedAt: null,
},
select: { id: true },
});
if (!image) {
console.warn(`⚠️ Image with ID ${imageId} not found`);
return null;
}
return image.id;
}