Hacktoberfest 2026: những issue maintainer đã đánh dấu cho tháng Mười, đang mở và phù hợp người mới. Xem issue Hacktoberfest

Expose Price sync actions in syncActions

Đang mở
#1,432 1 bình luận 0 reaction 1 người được giao Xem trên GitHub

@danrleyt đang làm issue này rồi.

Từ ngày 2/4/2020.

Đánh giá

Issue này chưa được đánh giá.

Mô tả

Type: New Feature Type: Onboarding Task
Description

In our project we need to calculate update actions for 2 price drafts. We don't have a full product representation for the old price. It'd be very useful to have a createSyncPrices API which would return update actions for 2 price drafts.

Something like this

import { createSyncPrices } from '@commercetools/sync-actions'
import { createClient } from '@commercetools/sdk-client'

const syncPrices = createSyncPrices()
const client = createClient({
  middlewares: [...],
})
const before = {
  // ...
}
const now = {
  // ...
}
const actions = syncPrices.buildActions(now, before)
const productsRequest = {
  url: `/products/${before.id}`,
  method: 'POST',
  body: JSON.stringify({ version: before.version, actions }),
}

client.execute(productsRequest)
.then(result => ...)
.catch(error => ...)
Current Behavior

Currently the only way to achieve the goal is to provide 2 empty products with prices for which we want to get update actions.

Ngôn ngữ chính
JavaScript
Star
77
Fork
70
Chỉ số merge pull request
Không có pull request nào được merge trong 30 ngày

Chuẩn bị môi trường

Bắt đầu từ đâu

  1. Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
  2. Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
  3. Fork repository và làm thay đổi trên một nhánh.
  4. Mở pull request có tham chiếu số hiệu của issue.

Issue khác của commercetools/nodejs

Tất cả issue của commercetools/nodejs

Issue tương tự

Thêm issue về JavaScript

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.