From 4458313b19d4277926df70616c587e90866f3b13 Mon Sep 17 00:00:00 2001 From: Tgrl84250 Date: Tue, 11 Jun 2024 10:39:21 +0200 Subject: [PATCH] Update useChecklists function to load local file instead of remote URL --- web/src/routes/layout.tsx | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/web/src/routes/layout.tsx b/web/src/routes/layout.tsx index 99ad960..53f0e5f 100644 --- a/web/src/routes/layout.tsx +++ b/web/src/routes/layout.tsx @@ -7,9 +7,9 @@ import Footer from "~/components/furniture/footer"; import { ChecklistContext } from "~/store/checklist-context"; import type { Sections } from "~/types/PSC"; -export const useChecklists = routeLoader$(async () => { - const remoteUrl = 'https://raw.githubusercontent.com/Lissy93/personal-security-checklist/HEAD/personal-security-checklist.yml'; - return fetch(remoteUrl) +export const useChecklists = routeLoader$(async ({ request }) => { + const localUrl = '/personal-security-checklist.yml'; + return fetch(new URL(localUrl, request.url).toString()) .then((res) => res.text()) .then((res) => jsyaml.load(res) as Sections) .catch(() => []);