diff --git a/web/src/routes/dashboard/tv/[showId=uuid]/+layout.ts b/web/src/routes/dashboard/tv/[showId=uuid]/+layout.ts index c551adc..4de3497 100644 --- a/web/src/routes/dashboard/tv/[showId=uuid]/+layout.ts +++ b/web/src/routes/dashboard/tv/[showId=uuid]/+layout.ts @@ -2,17 +2,17 @@ import type { LayoutLoad } from './$types'; import client from '$lib/api'; export const load: LayoutLoad = async ({ params, fetch }) => { - const show = await client.GET('/api/v1/tv/shows/{show_id}', { + const show = client.GET('/api/v1/tv/shows/{show_id}', { fetch: fetch, params: { path: { show_id: params.showId } } }); - const torrents = await client.GET('/api/v1/tv/shows/{show_id}/torrents', { + const torrents = client.GET('/api/v1/tv/shows/{show_id}/torrents', { fetch: fetch, params: { path: { show_id: params.showId } } }); return { - showData: show.data, - torrentsData: torrents.data + showData: await show.then((x) => x.data), + torrentsData: await torrents.then((x) => x.data) }; }; diff --git a/web/src/routes/dashboard/tv/[showId=uuid]/[SeasonId=uuid]/+page.ts b/web/src/routes/dashboard/tv/[showId=uuid]/[SeasonId=uuid]/+page.ts index f32b960..d42b132 100644 --- a/web/src/routes/dashboard/tv/[showId=uuid]/[SeasonId=uuid]/+page.ts +++ b/web/src/routes/dashboard/tv/[showId=uuid]/[SeasonId=uuid]/+page.ts @@ -2,7 +2,7 @@ import type { PageLoad } from './$types'; import client from '$lib/api'; export const load: PageLoad = async ({ fetch, params }) => { - const season = await client.GET('/api/v1/tv/seasons/{season_id}', { + const season = client.GET('/api/v1/tv/seasons/{season_id}', { fetch: fetch, params: { path: { @@ -10,7 +10,7 @@ export const load: PageLoad = async ({ fetch, params }) => { } } }); - const seasonFiles = await client.GET('/api/v1/tv/seasons/{season_id}/files', { + const seasonFiles = client.GET('/api/v1/tv/seasons/{season_id}/files', { fetch: fetch, params: { path: { @@ -19,7 +19,7 @@ export const load: PageLoad = async ({ fetch, params }) => { } }); return { - files: seasonFiles.data, - season: season.data + files: await seasonFiles.then((x) => x.data), + season: await season.then((x) => x.data) }; };