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([ await Promise.all([
cover ? handleCover(cover, 'album', albumId, tx) : undefined, cover ? handleCover(cover, 'album', albumId, tx) : undefined,
downloads downloads
? tx.downloads.createMany({ ? Promise.all(
data: downloads.map((d) => ({ downloads.map((d) =>
title: d.title, tx.downloads.create({
albumId: albumId, data: {
links: { create: d.links } title: d.title,
})) albumId: albumId,
}) links: { create: d.links }
}
})
)
)
: undefined : undefined
]) ])
}) })