Fix download link creation in album edit

This commit is contained in:
Jorge Vargas 2025-04-06 19:17:12 -06:00
parent 74d6bfbe77
commit c7d9605d81

View file

@ -66,13 +66,17 @@ export const POST: APIRoute = async ({ request, locals }) => {
await Promise.all([
cover ? handleCover(cover, 'album', albumId, tx) : undefined,
downloads
? tx.downloads.createMany({
data: downloads.map((d) => ({
title: d.title,
albumId: albumId,
links: { create: d.links }
}))
})
? Promise.all(
downloads.map((d) =>
tx.downloads.create({
data: {
title: d.title,
albumId: albumId,
links: { create: d.links }
}
})
)
)
: undefined
])
})