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([
|
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
|
||||||
])
|
])
|
||||||
})
|
})
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue