mirror of
https://github.com/kmc7468/arkvault.git
synced 2025-12-16 06:58:46 +00:00
오타 수정
This commit is contained in:
@@ -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,
|
||||
};
|
||||
}),
|
||||
|
||||
Reference in New Issue
Block a user