Skip to content

Commit 7c7100b

Browse files
committed
feat: update GetSearchResponse to use MultiSearchResponse and simplify SearchItem type
1 parent 42778c6 commit 7c7100b

File tree

1 file changed

+8
-6
lines changed

1 file changed

+8
-6
lines changed

api/src/search/types.ts

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,15 @@
1+
import { ContributionEntity } from "@dzcode.io/models/dist/contribution";
2+
import { ContributorEntity } from "@dzcode.io/models/dist/contributor";
13
import { GeneralResponse } from "src/app/types";
4+
import { MultiSearchResponse } from "meilisearch";
5+
import { ProjectEntity } from "@dzcode.io/models/dist/project";
26

37
export interface GetSearchResponse extends GeneralResponse {
4-
searchResults: Array<SearchItem>;
8+
searchResults: MultiSearchResponse<
9+
ProjectEntity | ContributionEntity | ContributorEntity
10+
>;
511
}
612

7-
export interface SearchItem {
8-
id: string;
9-
title: string;
10-
runId: string;
11-
}
13+
export type SearchItem = ProjectEntity | ContributionEntity | ContributorEntity;
1214

1315
export type SearchType = "project" | "contribution" | "contributor";

0 commit comments

Comments
 (0)