mirror of
https://github.com/jorgev259/soc_site-astro.git
synced 2025-06-29 07:57:41 +00:00
Fix download link creation in album edit
This commit is contained in:
parent
74d6bfbe77
commit
c7d9605d81
1 changed files with 11 additions and 7 deletions
|
|
@ -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
|
||||
])
|
||||
})
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue