Skip to main content
Updates every seller matching the selector with the given data. Triggered by POST /admin/sellers/:id and POST /vendor/sellers/:id. Emits seller.updated for each updated seller.

Usage

import { updateSellersWorkflow } from "@mercurjs/core/workflows"

const { result } = await updateSellersWorkflow(container).run({
  input: {
    selector: { id: "sel_123" },
    update: { name: "Acme Inc." },
  },
})

Input

selector
object
required
Filter selecting the sellers to update, e.g. { id: "sel_123" }.
update
UpdateSellerDTO
required
Fields to update; all optional.
additional_data
object
Custom data passed through to the workflow hooks.

Result

result
SellerDTO[]
The updated sellers.

Hooks

  • sellersUpdated — runs after the update with { sellers, additional_data }.
updateSellersWorkflow.hooks.sellersUpdated(async ({ sellers }) => {
  // sync updated sellers elsewhere
})