Bildupload fix

This commit is contained in:
Moritz Utcke
2025-03-19 12:21:06 -03:00
parent 915898c26f
commit 973fd76d1a

View File

@@ -25,6 +25,18 @@ export const PUT = defineApiRoute({
prisma.$transaction(async tx => {
for (const uid of input) {
const img = await tx.bild.findUnique({
where: {
uid
}
})
// Wenn das Bild bereits eine Aufnahme zugewiesen hat gehen wir einfach weiter.
if (img && img.aufnahme_id !== null) {
continue;
}
await tx.bild.update({
where: {
uid,