mirror of
https://github.com/aljazceru/claude-code-viewer.git
synced 2025-12-20 23:04:19 +01:00
fix: bug fix related to effect-ts refactor
This commit is contained in:
@@ -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;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user