From e03508f57c34eb7b69ec360cf87bbdbcadace327 Mon Sep 17 00:00:00 2001 From: Jorge Vargas Date: Sun, 6 Apr 2025 10:54:09 -0600 Subject: [PATCH] Fix album edit initial query --- src/components/adminAlbum/DownloadSections.tsx | 4 +--- src/pages/admin/album/[id].astro | 6 ++++-- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/src/components/adminAlbum/DownloadSections.tsx b/src/components/adminAlbum/DownloadSections.tsx index 1e07f75..861d1ef 100644 --- a/src/components/adminAlbum/DownloadSections.tsx +++ b/src/components/adminAlbum/DownloadSections.tsx @@ -7,12 +7,10 @@ import { Input, InputSelect } from 'components/form/Input' import { DownloadProvider } from 'utils/consts' type Download = Prisma.downloadsGetPayload<{ - select: { title: true } - include: { links: { select: { provider: true; directUrl: true; url: true; url2: true } } } + select: { title: true; links: { select: { provider: true; url: true; url2: true; directUrl: true } } } }> const defaultLink = { provider: DownloadProvider.MEDIAFIRE, url: null, url2: null, directUrl: null } -//@ts-ignore const defaultSection: Download = { title: '', links: [defaultLink] } interface Props { diff --git a/src/pages/admin/album/[id].astro b/src/pages/admin/album/[id].astro index 4a3da69..ddbb767 100644 --- a/src/pages/admin/album/[id].astro +++ b/src/pages/admin/album/[id].astro @@ -30,8 +30,10 @@ const album = await prismaClient.albums.findUnique({ } }, stores: { select: { provider: true, url: true } }, - downloads: { select: { title: true }, include: { links: true } }, - discs: true + downloads: { + select: { title: true, links: { select: { provider: true, url: true, url2: true, directUrl: true } } } + }, + discs: { select: { number: true, body: true } } } })