Skip to content

Commit 2114fd1

Browse files
authored
Fix Search tab (#871)
1 parent 2d10dca commit 2114fd1

File tree

3 files changed

+16
-7
lines changed

3 files changed

+16
-7
lines changed

mwdb/web/src/components/RecentView/Views/RecentViewList.tsx

+5-5
Original file line numberDiff line numberDiff line change
@@ -117,13 +117,13 @@ export function RecentViewList(props: Props) {
117117
let elements: Elements = [];
118118
if (props.type === "blob") {
119119
elements = response.data.blobs as BlobData[];
120-
}
121-
if (props.type === "config") {
120+
} else if (props.type === "config") {
122121
elements = response.data.configs as ConfigData[];
123-
}
124-
if (props.type === "file") {
122+
} else if (props.type === "file") {
125123
elements = response.data.files as ObjectData[];
126-
}
124+
} else if (props.type === "object") {
125+
elements = response.data.objects as ObjectData[];
126+
} else throw new Error("Unexpected object type");
127127
listDispatch({
128128
type: "pageLoaded",
129129
elements,

mwdb/web/src/types/api.ts

+4-2
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ import {
99
ConfigData,
1010
ConfigListItem,
1111
Family,
12+
FileListItem,
1213
Group,
1314
KartonAnalysis,
1415
ObjectData,
@@ -73,9 +74,10 @@ export type ApiKeyRemoveResponse = Response<null>;
7374
export type GetObjectResponse = Response<ObjectOrConfigOrBlobData>;
7475

7576
export type GetObjectListResponse = Response<{
76-
blobs?: BlobListItem[];
77-
files?: ObjectListItem[];
77+
files?: FileListItem[];
7878
configs?: ConfigListItem[];
79+
blobs?: BlobListItem[];
80+
objects?: ObjectListItem[];
7981
}>;
8082

8183
export type GetObjectCountResponse = Response<{

mwdb/web/src/types/types.ts

+7
Original file line numberDiff line numberDiff line change
@@ -141,6 +141,13 @@ export type BlobData = ObjectCommonData & {
141141
};
142142

143143
export type ObjectListItem = {
144+
id: string;
145+
tags: Tag[];
146+
type: ObjectLegacyType;
147+
upload_time: string;
148+
};
149+
150+
export type FileListItem = {
144151
file_name: string;
145152
file_size: number;
146153
file_type: string;

0 commit comments

Comments
 (0)