fix: bug fix related to effect-ts refactor

This commit is contained in:
d-kimsuon
2025-10-17 17:16:08 +09:00
parent 1795cb499b
commit a5d81568bb
28 changed files with 1022 additions and 196 deletions

View File

@@ -1,3 +1,4 @@
import type { DirectoryListingResult } from "../../server/service/directory-browser/getDirectoryListing";
import type { FileCompletionResult } from "../../server/service/file-completion/getFileCompletion";
import { honoClient } from "./client";
@@ -16,6 +17,22 @@ export const projectListQuery = {
},
} as const;
export const directoryListingQuery = (currentPath?: string) =>
({
queryKey: ["directory-listing", currentPath],
queryFn: async (): Promise<DirectoryListingResult> => {
const response = await honoClient.api["directory-browser"].$get({
query: currentPath ? { currentPath } : {},
});
if (!response.ok) {
throw new Error("Failed to fetch directory listing");
}
return await response.json();
},
}) as const;
export const projectDetailQuery = (projectId: string, cursor?: string) =>
({
queryKey: ["projects", projectId],
@@ -70,7 +87,7 @@ export const sessionDetailQuery = (projectId: string, sessionId: string) =>
throw new Error(`Failed to fetch session: ${response.statusText}`);
}
return response.json();
return await response.json();
},
}) as const;