File tree Expand file tree Collapse file tree 2 files changed +13
-9
lines changed
Expand file tree Collapse file tree 2 files changed +13
-9
lines changed Original file line number Diff line number Diff line change 1- import { SearchItem , SearchType } from "./types" ;
1+ import { SearchResults , SearchType } from "./types" ;
22
33import { BaseSearchItem } from "@dzcode.io/models/dist/_base" ;
44import { ConfigService } from "src/config/service" ;
@@ -26,9 +26,11 @@ export class SearchService {
2626 } ) ;
2727 }
2828
29- public search = async ( query : string ) : Promise < SearchItem [ ] > => {
29+ public search = async ( query : string ) : Promise < SearchResults > => {
3030 this . logger . info ( { message : `Searching for ${ query } ` } ) ;
31- return [ ] ;
31+ return {
32+ results : [ ] ,
33+ } ;
3234 } ;
3335
3436 public upsert = async < T extends BaseSearchItem > (
Original file line number Diff line number Diff line change 1+ import { ContributionEntity } from "@dzcode.io/models/dist/contribution" ;
2+ import { ContributorEntity } from "@dzcode.io/models/dist/contributor" ;
13import { GeneralResponse } from "src/app/types" ;
4+ import { MultiSearchResponse } from "meilisearch" ;
5+ import { ProjectEntity } from "@dzcode.io/models/dist/project" ;
26
37export interface GetSearchResponse extends GeneralResponse {
4- searchResults : Array < SearchItem > ;
8+ searchResults : SearchResults ;
59}
610
7- export interface SearchItem {
8- id : string ;
9- title : string ;
10- runId : string ;
11- }
11+ export type SearchResults = MultiSearchResponse < SearchItem > ;
12+
13+ type SearchItem = ProjectEntity | ContributionEntity | ContributorEntity ;
1214
1315export type SearchType = "project" | "contribution" | "contributor" ;
You can’t perform that action at this time.
0 commit comments