Function: usePlaceOrder()
usePlaceOrder(
param
: {mutation
:MutationOptions
<Order
,Error
,NewOrder
>;supportingDocument
:File
; }):MutationResult
<"placeOrder"
,Order
,Error
,NewOrder
>
When the order has been placed, the orders query will be invalidated and re-fetched.
If the order amount is above 15000, a supporting document is required.
Parameters
Parameter | Type | Description |
---|---|---|
param | object | |
param.mutation ? | MutationOptions <Order , Error , NewOrder > | See Tanstack Query - useMutation options. |
param.supportingDocument ? | File | Supporting document file. |
Returns
MutationResult
<"placeOrder"
, Order
, Error
, NewOrder
>
Example
const {
placeOrder, // useMutation's `mutateAsync` property
isPending,
isError,
error,
status,
...moreUseMutationResults
} = usePlaceOrder();