fix(orders): send version and idempotency key for platform cancellation

This commit is contained in:
2026-10-02 23:16:19 +08:00
parent 678bccd4d1
commit bca08f8749
2 changed files with 14 additions and 11 deletions
@@ -184,12 +184,17 @@ export function startPlatformFirstLegOrder(tenantId: string, orderId: string) {
return postData<void>(`/platform/v1/orders/first-leg/${orderId}/start`, undefined, { tenantId })
}
export function completePlatformFirstLegOrder(tenantId: string, orderId: string) {
return postData<void>(`/platform/v1/orders/first-leg/${orderId}/complete`, undefined, { tenantId })
}
export function cancelPlatformFirstLegOrder(tenantId: string, orderId: string, reason: string) {
return postData<void>(`/platform/v1/orders/first-leg/${orderId}/cancel`, { reason }, { tenantId })
export async function cancelPlatformFirstLegOrder(
tenantId: string,
orderId: string,
payload: { expectedVersion: number; reason: string },
idempotencyKey: string,
) {
const response = await http.post<ApiEnvelope<void>, ApiEnvelope<void>>(
`/platform/v1/orders/first-leg/${orderId}/cancel`, payload,
{ params: { tenantId }, headers: { 'Idempotency-Key': idempotencyKey } },
)
return unwrapApiResponse(response)
}
export function updatePlatformFirstLegOrderExpress(