Refactor mosaic
This commit is contained in:
@ -18,6 +18,7 @@ export async function updateImage(
|
||||
originalFile,
|
||||
nsfw,
|
||||
published,
|
||||
setAsHeader,
|
||||
altText,
|
||||
description,
|
||||
fileType,
|
||||
@ -29,6 +30,14 @@ export async function updateImage(
|
||||
categoryIds
|
||||
} = validated.data;
|
||||
|
||||
if(setAsHeader) {
|
||||
await prisma.portfolioImage.updateMany({
|
||||
where: { setAsHeader: true },
|
||||
data: { setAsHeader: false },
|
||||
})
|
||||
}
|
||||
|
||||
|
||||
const updatedImage = await prisma.portfolioImage.update({
|
||||
where: { id: id },
|
||||
data: {
|
||||
@ -36,6 +45,7 @@ export async function updateImage(
|
||||
originalFile,
|
||||
nsfw,
|
||||
published,
|
||||
setAsHeader,
|
||||
altText,
|
||||
description,
|
||||
fileType,
|
||||
|
Reference in New Issue
Block a user