Working sorting kinda?
This commit is contained in:
@ -9,15 +9,18 @@ export default async function PortfolioImagesEditPage({ params }: { params: { id
|
||||
const image = await prisma.portfolioImage.findUnique({
|
||||
where: { id },
|
||||
include: {
|
||||
album: true,
|
||||
type: true,
|
||||
metadata: true,
|
||||
categories: true,
|
||||
colors: { include: { color: true } },
|
||||
sortContexts: true,
|
||||
tags: true,
|
||||
variants: true
|
||||
}
|
||||
})
|
||||
|
||||
const albums = await prisma.portfolioAlbum.findMany({ orderBy: { sortIndex: "asc" } });
|
||||
const categories = await prisma.portfolioCategory.findMany({ orderBy: { sortIndex: "asc" } });
|
||||
const tags = await prisma.portfolioTag.findMany({ orderBy: { sortIndex: "asc" } });
|
||||
const types = await prisma.portfolioType.findMany({ orderBy: { sortIndex: "asc" } });
|
||||
@ -29,7 +32,7 @@ export default async function PortfolioImagesEditPage({ params }: { params: { id
|
||||
<h1 className="text-2xl font-bold mb-4">Edit image</h1>
|
||||
<div className="grid grid-cols-1 lg:grid-cols-2 gap-8">
|
||||
<div>
|
||||
{image ? <EditImageForm image={image} tags={tags} categories={categories} types={types} /> : 'Image not found...'}
|
||||
{image ? <EditImageForm image={image} albums={albums} tags={tags} categories={categories} types={types} /> : 'Image not found...'}
|
||||
<div className="mt-6">
|
||||
{image && <DeleteImageButton imageId={image.id} />}
|
||||
</div>
|
||||
|
Reference in New Issue
Block a user