refactor: Use `FreshContext` instead of deprecated `HandlerContext`

Signed-off-by: Tim Hårek Andreassen <tim@harek.no>
This commit is contained in:
Tim Hårek Andreassen 2024-03-02 18:21:01 +01:00
parent 353466992f
commit dda88eb75c
No known key found for this signature in database
GPG Key ID: E59C7734F0E10EB5
2 changed files with 4 additions and 3 deletions

View File

@ -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<Response> => {
export const handler = async (_req: Request, ctx: FreshContext): Promise<Response> => {
const seriesId = ctx.params.seriesId;
const feedContent = await buildFeed(seriesId);

View File

@ -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<Response> => {
export const handler = async (_req: Request, ctx: FreshContext): Promise<Response> => {
const seriesId = ctx.params.seriesId;
const episodeId = ctx.params.episodeId;