Skip to content

Commit

Permalink
🐛 (composable/event-loader) download先を修正
Browse files Browse the repository at this point in the history
  • Loading branch information
Shion1305 committed Oct 25, 2023
1 parent 60eedfe commit 63248b7
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions composables/events-loader.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,14 +4,14 @@ import { EventData } from "~/model/eventData";

let events_data: EventData[] = [];

const zipUrl = useRuntimeConfig().app.baseURL + "/data/events.zip";

export async function useDataLoader() {
if (events_data.length > 0) return { events_data };
events_data = await (async function (): Promise<EventData[]> {
const downloaded_data: EventData[] = [];
try {
const zip_data = await fetch("/data/events.zip").then((res) =>
res.blob(),
);
const zip_data = await fetch(zipUrl).then((res) => res.blob());
const zip = await JSZip.loadAsync(zip_data);
const fileNames = Object.keys(zip.files);

Expand Down

0 comments on commit 63248b7

Please sign in to comment.