Skip to content

Commit 89f20bf

Browse files
committed
Refactor search functionality to simplify parameters
1 parent 8b3e0d5 commit 89f20bf

File tree

2 files changed

+4
-8
lines changed

2 files changed

+4
-8
lines changed

api/src/search/controller.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ export class SearchController {
1111

1212
@Get("/")
1313
public async search(): Promise<GetSearchResponse> {
14-
const searchResults = await this.searchService.search("project", "test");
14+
const searchResults = await this.searchService.search("test");
1515
return {
1616
searchResults,
1717
};

api/src/search/service.ts

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,7 @@
1-
import { SearchItem, SearchType } from "./types";
2-
31
import { ConfigService } from "src/config/service";
42
import { LoggerService } from "src/logger/service";
53
import { MeiliSearch } from "meilisearch";
4+
import { SearchItem } from "./types";
65
import { Service } from "typedi";
76

87
@Service()
@@ -21,11 +20,8 @@ export class SearchService {
2120
});
2221
}
2322

24-
public search = async (
25-
index: SearchType,
26-
query: string,
27-
): Promise<SearchItem[]> => {
28-
this.logger.info({ message: `Searching ${index} for ${query}` });
23+
public search = async (query: string): Promise<SearchItem[]> => {
24+
this.logger.info({ message: `Searching for ${query}` });
2925
return [];
3026
};
3127
}

0 commit comments

Comments
 (0)