Refactor color generaton on artwork single page
This commit is contained in:
11
src/actions/artworks/getArtworkColors.ts
Normal file
11
src/actions/artworks/getArtworkColors.ts
Normal file
@ -0,0 +1,11 @@
|
||||
"use server";
|
||||
|
||||
import { prisma } from "@/lib/prisma";
|
||||
|
||||
export async function getArtworkColors(artworkId: string) {
|
||||
return prisma.artworkColor.findMany({
|
||||
where: { artworkId },
|
||||
include: { color: true },
|
||||
orderBy: [{ type: "asc" }],
|
||||
});
|
||||
}
|
||||
Reference in New Issue
Block a user