Fix album edit initial query

This commit is contained in:
Jorge Vargas 2025-04-06 10:54:09 -06:00
parent 6cef84a358
commit e03508f57c
2 changed files with 5 additions and 5 deletions

View file

@ -7,12 +7,10 @@ import { Input, InputSelect } from 'components/form/Input'
import { DownloadProvider } from 'utils/consts' import { DownloadProvider } from 'utils/consts'
type Download = Prisma.downloadsGetPayload<{ type Download = Prisma.downloadsGetPayload<{
select: { title: true } select: { title: true; links: { select: { provider: true; url: true; url2: true; directUrl: true } } }
include: { links: { select: { provider: true; directUrl: true; url: true; url2: true } } }
}> }>
const defaultLink = { provider: DownloadProvider.MEDIAFIRE, url: null, url2: null, directUrl: null } const defaultLink = { provider: DownloadProvider.MEDIAFIRE, url: null, url2: null, directUrl: null }
//@ts-ignore
const defaultSection: Download = { title: '', links: [defaultLink] } const defaultSection: Download = { title: '', links: [defaultLink] }
interface Props { interface Props {

View file

@ -30,8 +30,10 @@ const album = await prismaClient.albums.findUnique({
} }
}, },
stores: { select: { provider: true, url: true } }, stores: { select: { provider: true, url: true } },
downloads: { select: { title: true }, include: { links: true } }, downloads: {
discs: true select: { title: true, links: { select: { provider: true, url: true, url2: true, directUrl: true } } }
},
discs: { select: { number: true, body: true } }
} }
}) })