commercetools / commercetools/nodejs

api-request-builder: Request to Add Locale and Store Query Parameters

Open
#1,671 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
JavaScript
Stars
77
Forks
70
PR merge metrics
No merged PRs in 30d

Description

### Support reference number

**N/A**

### Description

Currently we are unable to use / apply store or locale query parameters using the fluent api request builder package.

```typescript
const uri = requestBuilder.productProjections
.locale('locale')
.byKey('key')
.build();

const uri = requestBuilder.productProjections
.store('store')
.byKey('key')
.build();
```

**ref:**
https://docs.commercetools.com/api/projects/productProjections#get-productprojection-by-key

### Expected Behavior

See possible solution and examples of what we would hope could be a possible api addition.

### Current Behavior

Functions for these beta `Query Parameters` currently not available.

### Context

Looking to keep our codebase clean and use the fluent api for all of our requests.

### Possible Solution

Add the beta options for:

* storeProjection
* localeProjection

```
const uri = requestBuilder.productProjections
.locale('de-DE')
.byKey('key')
.build();
```

```
const uri = requestBuilder.productProjections
.store('store')
.byKey('key')
.build();
```

https://github.com/commercetools/nodejs/blob/aa630f042929864d0a06a6461e876ec305d5a775/packages/api-request-builder/src/query-projection.js

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.