Bildupload fix
This commit is contained in:
@@ -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,
|
||||
|
||||
Reference in New Issue
Block a user