fix: scope smart loading recommendation requests
This commit is contained in:
@@ -380,8 +380,20 @@ export async function assignSmartLoadingGroup(planId: string, inboundId: string,
|
||||
)
|
||||
return plan(unwrapApiResponse(response))
|
||||
}
|
||||
export async function recommendSmartLoading(planId: string, expectedVersion: number) {
|
||||
const response = await http.post<ApiEnvelope<SmartLoadingPlan>, ApiEnvelope<SmartLoadingPlan>>(`${smartLoadingPath}/plans/${encodeURIComponent(planId)}/recommend`, { expectedVersion, operationId: operationId('recommend') })
|
||||
export async function recommendSmartLoading(
|
||||
planId: string,
|
||||
expectedVersion: number,
|
||||
scope: { customerId?: string; inboundCode?: string } = {},
|
||||
) {
|
||||
const response = await http.post<ApiEnvelope<SmartLoadingPlan>, ApiEnvelope<SmartLoadingPlan>>(
|
||||
`${smartLoadingPath}/plans/${encodeURIComponent(planId)}/recommend`,
|
||||
{
|
||||
expectedVersion,
|
||||
operationId: operationId('recommend'),
|
||||
...(scope.customerId ? { customerId: scope.customerId } : {}),
|
||||
...(scope.inboundCode?.trim() ? { inboundCode: scope.inboundCode.trim() } : {}),
|
||||
},
|
||||
)
|
||||
return plan(unwrapApiResponse(response))
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user