mirror of
https://github.com/Lissy93/personal-security-checklist.git
synced 2026-03-11 08:55:32 +00:00
Update useChecklists function to load local file instead of remote URL
This commit is contained in:
parent
6730746b0d
commit
4458313b19
1 changed files with 3 additions and 3 deletions
|
|
@ -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(() => []);
|
||||
|
|
|
|||
Loading…
Reference in a new issue