Expose Price sync actions in syncActions
@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ả
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
- Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
- 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.
- Fork repository và làm thay đổi trên một nhánh.
- Mở pull request có tham chiếu số hiệu của issue.
Issue khác của commercetools/nodejs
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 35/100
commercetools/nodejs#1901 ·
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 45/100
commercetools/nodejs#1895 · 1 bình luận ·
-
Độ khó 1/5 1-3 giờ Mức phù hợp với người mới 55/100
commercetools/nodejs#1891 ·
-
Độ khó 5/5 Hơn một tuần Mức phù hợp với người mới 20/100
commercetools/nodejs#1889 ·
-
Độ khó 3/5 1-2 ngày Mức phù hợp với người mới 35/100
commercetools/nodejs#1884 · 4 reaction ·
Tất cả issue của commercetools/nodejs
Issue tương tự
-
feature task
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 72/100
RealDevSquad/website-www#1178 ·
-
add latest sol modelĐang mở
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 68/100
netlify-labs/nax#56 · 2 bình luận · 1 reaction ·
-
accessibility bug revealjs
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 84/100
quarto-dev/quarto-cli#14961 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 1/5 Dưới một giờ Mức phù hợp với người mới 88/100
PnX-SI/GeoNature#4435 · 2 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày
-
bug
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 85/100
openlayers/openlayers#17648 ·
Maintainer thường phản hồi trong vòng 1 ngày