Skip to content

Commit

Permalink
Fix Search tab (#871)
Browse files Browse the repository at this point in the history
  • Loading branch information
psrok1 committed Jul 31, 2023
1 parent 2d10dca commit 2114fd1
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 7 deletions.
10 changes: 5 additions & 5 deletions mwdb/web/src/components/RecentView/Views/RecentViewList.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -117,13 +117,13 @@ export function RecentViewList(props: Props) {
let elements: Elements = [];
if (props.type === "blob") {
elements = response.data.blobs as BlobData[];
}
if (props.type === "config") {
} else if (props.type === "config") {
elements = response.data.configs as ConfigData[];
}
if (props.type === "file") {
} else if (props.type === "file") {
elements = response.data.files as ObjectData[];
}
} else if (props.type === "object") {
elements = response.data.objects as ObjectData[];
} else throw new Error("Unexpected object type");
listDispatch({
type: "pageLoaded",
elements,
Expand Down
6 changes: 4 additions & 2 deletions mwdb/web/src/types/api.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ import {
ConfigData,
ConfigListItem,
Family,
FileListItem,
Group,
KartonAnalysis,
ObjectData,
Expand Down Expand Up @@ -73,9 +74,10 @@ export type ApiKeyRemoveResponse = Response<null>;
export type GetObjectResponse = Response<ObjectOrConfigOrBlobData>;

export type GetObjectListResponse = Response<{
blobs?: BlobListItem[];
files?: ObjectListItem[];
files?: FileListItem[];
configs?: ConfigListItem[];
blobs?: BlobListItem[];
objects?: ObjectListItem[];
}>;

export type GetObjectCountResponse = Response<{
Expand Down
7 changes: 7 additions & 0 deletions mwdb/web/src/types/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -141,6 +141,13 @@ export type BlobData = ObjectCommonData & {
};

export type ObjectListItem = {
id: string;
tags: Tag[];
type: ObjectLegacyType;
upload_time: string;
};

export type FileListItem = {
file_name: string;
file_size: number;
file_type: string;
Expand Down

0 comments on commit 2114fd1

Please sign in to comment.