Hacktoberfest 2026: le issue che i maintainer hanno segnato per ottobre, aperte e adatte ai principianti. Sfoglia le issue Hacktoberfest

Expose Price sync actions in syncActions

Aperta
#1,432 1 commento 0 reazioni 1 assegnatario Vedi su GitHub

@danrleyt ci sta già lavorando.

Dal 2/4/2020.

Valutazione

Questa issue non è ancora stata valutata.

Descrizione

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.

Lingua principale
JavaScript
Stelle
77
Fork
70
Metriche di merge delle PR
Nessuna PR unita negli ultimi 30g

Preparare l'ambiente

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di commercetools/nodejs

Tutte le issue di commercetools/nodejs

Issue simili

Altre issue su JavaScript

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.