Skip to main content
Skip to main content

update - Order Module Reference

This documentation provides a reference to the update method. This belongs to the Order Module.

update(data): Promise<OrderDTO[]>

This method updates existing {return type}(s).

Example

const updatedOrders = await orderModuleService.update([
{
id: "order_id_1",
status: "shipped"
},
{
id: "order_id_2",
status: "delivered"
}
]);

Parameters

dataUpdateOrderDTO[]Required
The attributes to update in the order.

Returns

PromisePromise<OrderDTO[]>Required
The updated {return type}(s).

update(orderId, data, sharedContext?): Promise<OrderDTO>

This method updates existing {return type}(s).

Example

await orderModuleService.update("orderId123", {
status: "shipped"
});

Parameters

orderIdstringRequired
The order's ID.
dataUpdateOrderDTORequired
The attributes to update in the order.
sharedContextContext
A context used to share resources, such as transaction manager, between the application and the module.

Returns

PromisePromise<OrderDTO>Required
The updated {return type}(s).

update(selector, data, sharedContext?): Promise<OrderDTO[]>

This method updates existing {return type}(s).

Example

await orderModuleService.update(
{ id: "order-123" },
{ status: "completed" }
);

Parameters

selectorPartial<FilterableOrderProps>Required
Make all properties in T optional
dataUpdateOrderDTORequired
The attributes to update in the order.
sharedContextContext
A context used to share resources, such as transaction manager, between the application and the module.

Returns

PromisePromise<OrderDTO[]>Required
The updated {return type}(s).
Was this section helpful?