오타 수정

This commit is contained in:
static
2025-01-06 14:12:23 +09:00
parent 6bf40e4ab4
commit bd0dd3343a
12 changed files with 43 additions and 43 deletions

View File

@@ -1,7 +1,7 @@
import { error } from "@sveltejs/kit";
import { z } from "zod";
import { callGetApi } from "$lib/hooks";
import type { DirectroyInfoResponse, FileInfoResponse } from "$lib/server/schemas";
import type { DirectoryInfoResponse, FileInfoResponse } from "$lib/server/schemas";
import type { PageLoad } from "./$types";
export const load: PageLoad = async ({ params, fetch }) => {
@@ -17,13 +17,13 @@ export const load: PageLoad = async ({ params, fetch }) => {
const res = await callGetApi(`/api/directory/${directoryId}`, fetch);
if (!res.ok) error(404, "Not found");
const directoryInfo: DirectroyInfoResponse = await res.json();
const directoryInfo: DirectoryInfoResponse = await res.json();
const subDirectoryInfos = await Promise.all(
directoryInfo.subDirectories.map(async (subDirectoryId) => {
const res = await callGetApi(`/api/directory/${subDirectoryId}`, fetch);
if (!res.ok) error(500, "Internal server error");
return {
...((await res.json()) as DirectroyInfoResponse),
...((await res.json()) as DirectoryInfoResponse),
id: subDirectoryId,
};
}),