优化
This commit is contained in:
@@ -120,9 +120,9 @@ function truckPayload(context, oceanBooking, carrier, index) {
|
||||
|
||||
async function createTruck(context, oceanBooking, index) {
|
||||
const carrierResponse = await context.request('GET',
|
||||
'/api/platform/v1/suppliers?tenantId=0&category=TRUCKING&status=ACTIVE&page=1&size=20')
|
||||
'/api/platform/v1/suppliers?tenantId=0&category=TRUCKING&status=ACTIVE&truckingScope=DOMESTIC&page=1&size=20')
|
||||
const carrierPage = context.apiSuccess(MODULE, `读取拖车状态样本 ${index} 的 ACTIVE 承运商`, carrierResponse, '', OPTIONS)
|
||||
const carrier = carrierPage?.records?.find?.((item) => item?.id && item?.name)
|
||||
const carrier = carrierPage?.records?.find?.((item) => item?.id && item?.name && item?.truckingScope === 'DOMESTIC')
|
||||
if (!carrier) throw new Error(`创建拖车样本 ${index} 缺少 ACTIVE 承运商`)
|
||||
const response = await context.request('POST', TRUCK_BASE, truckPayload(context, oceanBooking, carrier, index))
|
||||
const value = context.apiSuccess(MODULE, `创建拖车状态样本 ${index}`, response, '', OPTIONS)
|
||||
|
||||
Reference in New Issue
Block a user