Hacktoberfest 2026:维护者为十月标记出来的 issue,仍然开放、适合新手。 浏览 Hacktoberfest issue

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

未关闭
#1,671 0 条评论 0 个 reaction 已指派 0 人 在 GitHub 查看

还没有人认领这个 Issue。

评估

难度
2/5
预计耗时
1-3 小时
新手友好度
52/100
Issue 类型
功能
描述清晰度
描述清楚
活跃度
停滞
技术栈
javascript
领域
api

调研方向

从 packages/api-request-builder/src/query-projection.js 开始,检查产品投影请求是如何组装的。使用文档中记录的 product-projection-by-key endpoint 和 issue 中的示例,验证 locale 和 store 查询参数是否包含在构建出的请求 URL 中。

由索引模型根据 Issue 内容生成。

描述

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.

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

主要语言
JavaScript
星标
77
派生
70
PR 合并指标
30 天内没有已合并 PR

环境准备

从这里开始

  1. 先读完整个 Issue,再读项目的贡献指南。
  2. 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
  3. Fork 仓库,在一个分支上完成修改。
  4. 提交 Pull Request,并在描述里引用这个 Issue 编号。

commercetools/nodejs 的其他 Issue

查看 commercetools/nodejs 的全部 Issue

相似的 Issue

更多 JavaScript Issue

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。