Skip to content

Commit 1fc2856

Browse files
jochem25claude
andcommitted
Fix cloud open: add category=bim to file list and download API calls
The backend defaults to category=output (validation/ dir) but IFC models live in models/. Without passing category=bim, the file list was empty and no files could be opened from cloud storage. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
1 parent 767609d commit 1fc2856

1 file changed

Lines changed: 7 additions & 3 deletions

File tree

viewer/src/api/cloudApi.ts

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -83,11 +83,14 @@ export async function cloudListProjects(): Promise<CloudProject[]> {
8383
}
8484

8585
/** List files in a project's tool subdirectory. */
86-
export async function cloudListFiles(project: string): Promise<CloudFile[]> {
86+
export async function cloudListFiles(
87+
project: string,
88+
category: "bim" | "output" = "bim",
89+
): Promise<CloudFile[]> {
8790
let response: Response;
8891
try {
8992
response = await fetch(
90-
`${CLOUD_BASE}/projects/${encodeURIComponent(project)}/files`,
93+
`${CLOUD_BASE}/projects/${encodeURIComponent(project)}/files?category=${category}`,
9194
);
9295
} catch (error) {
9396
throw new ApiError(
@@ -110,11 +113,12 @@ export async function cloudListFiles(project: string): Promise<CloudFile[]> {
110113
export async function cloudDownloadFile(
111114
project: string,
112115
filename: string,
116+
category: "bim" | "output" = "bim",
113117
): Promise<Blob> {
114118
let response: Response;
115119
try {
116120
response = await fetch(
117-
`${CLOUD_BASE}/projects/${encodeURIComponent(project)}/files/${encodeURIComponent(filename)}`,
121+
`${CLOUD_BASE}/projects/${encodeURIComponent(project)}/files/${encodeURIComponent(filename)}?category=${category}`,
118122
);
119123
} catch (error) {
120124
throw new ApiError(

0 commit comments

Comments
 (0)