Skip to content

Commit

Permalink
Bump version to 4.0.3 and add searchByCodes method in BrxProductSearc…
Browse files Browse the repository at this point in the history
…hAdapter
  • Loading branch information
vahid.mehrjouei committed Jan 3, 2025
1 parent bba90ea commit e9d5560
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 4 deletions.
4 changes: 2 additions & 2 deletions brx-spartacus-library/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion brx-spartacus-library/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@bloomreach/brx-spartacus-library",
"version": "4.0.2",
"version": "4.0.3",
"description": "Bloomreach Spartacus Integration Library",
"keywords": [
"bloomreach",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ export class BrxProductSearchAdapter implements ProductSearchAdapter {
protected http: HttpClient,
protected converter: ConverterService,
protected brxEndpointService: BrxEndpointService,
) {}
) { }

Check failure on line 53 in brx-spartacus-library/src/lib/spartacus/brx/adapters/brx-product-search-adapter.ts

View workflow job for this annotation

GitHub Actions / Build, lint & test

Delete `·`

search(query = '', searchConfig: BrxSearchConfig = DEFAULT_SEARCH_CONFIG): Observable<ProductSearchPage> {
// console.log('[** Product Search Adapter - Custom Brx API Req---]', query, searchConfig);
Expand Down Expand Up @@ -100,6 +100,13 @@ export class BrxProductSearchAdapter implements ProductSearchAdapter {
);
}

searchByCodes(codes: string[]) {
return this.http.get<any[]>(this.getSearchEndpoint(codes.toString(), {})).pipe(
this.converter.pipeableMany(PRODUCT_NORMALIZER),
map((products) => ({ products }))

Check failure on line 106 in brx-spartacus-library/src/lib/spartacus/brx/adapters/brx-product-search-adapter.ts

View workflow job for this annotation

GitHub Actions / Build, lint & test

Insert `,`
);
}

loadSuggestions(term: string, pageSize = 3): Observable<Suggestion[]> {
return this.http.get(this.getSuggestionEndpoint(term)).pipe(
map((response: any) => response.response?.suggestions || []),
Expand Down

0 comments on commit e9d5560

Please sign in to comment.