From dda88eb75c7f713e56af78393573d8c1ca950e8f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tim=20H=C3=A5rek=20Andreassen?= Date: Sat, 2 Mar 2024 18:21:01 +0100 Subject: [PATCH] refactor: Use `FreshContext` instead of deprecated `HandlerContext` MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Tim HÄrek Andreassen --- routes/api/feeds/[seriesId].ts | 4 ++-- routes/api/feeds/[seriesId]/[episodeId]/chapters.ts | 3 ++- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/routes/api/feeds/[seriesId].ts b/routes/api/feeds/[seriesId].ts index 703a581..588cbf3 100644 --- a/routes/api/feeds/[seriesId].ts +++ b/routes/api/feeds/[seriesId].ts @@ -1,5 +1,5 @@ import { Episode, nrkRadio } from "../../../lib/nrk.ts"; -import { HandlerContext } from "$fresh/server.ts"; +import { FreshContext } from "$fresh/server.ts"; import { declaration, serialize, tag } from "https://raw.githubusercontent.com/olaven/serialize-xml/v0.4.0/mod.ts"; import { getHostName } from "../../../utils.ts"; @@ -86,7 +86,7 @@ async function buildFeed(seriesId: string) { ); } -export const handler = async (_req: Request, ctx: HandlerContext): Promise => { +export const handler = async (_req: Request, ctx: FreshContext): Promise => { const seriesId = ctx.params.seriesId; const feedContent = await buildFeed(seriesId); diff --git a/routes/api/feeds/[seriesId]/[episodeId]/chapters.ts b/routes/api/feeds/[seriesId]/[episodeId]/chapters.ts index 7a2b26d..3ec715c 100644 --- a/routes/api/feeds/[seriesId]/[episodeId]/chapters.ts +++ b/routes/api/feeds/[seriesId]/[episodeId]/chapters.ts @@ -1,3 +1,4 @@ +import { FreshContext } from "$fresh/server.ts"; import { parse, toSeconds } from "https://esm.sh/iso8601-duration@2.1.1"; import { nrkRadio, OriginalEpisode } from "../../../../../lib/nrk.ts"; @@ -8,7 +9,7 @@ function toChapters(episode: OriginalEpisode) { })); } -export const handler = async (_req: Request, ctx: HandlerContext): Promise => { +export const handler = async (_req: Request, ctx: FreshContext): Promise => { const seriesId = ctx.params.seriesId; const episodeId = ctx.params.episodeId;