feat: add lingxing connection test action
This commit is contained in:
@@ -40,6 +40,25 @@ export interface MojiaSkuSyncConfig {
|
||||
autoSyncEnabled: boolean
|
||||
}
|
||||
|
||||
export interface LingxingWarehouseTestResult {
|
||||
whCode: string
|
||||
reachable: boolean
|
||||
matched: boolean
|
||||
maintained: boolean
|
||||
productSku?: string | null
|
||||
barcode?: string | null
|
||||
length?: number | null
|
||||
width?: number | null
|
||||
height?: number | null
|
||||
weight?: number | null
|
||||
message: string
|
||||
}
|
||||
|
||||
export interface LingxingConnectionTestResult {
|
||||
skuCode: string
|
||||
warehouses: LingxingWarehouseTestResult[]
|
||||
}
|
||||
|
||||
const basePath = '/platform/v1/firstleg/mojia-sku-sync'
|
||||
|
||||
export async function listMojiaSkuSync(query: MojiaSkuSyncQuery) {
|
||||
@@ -56,6 +75,13 @@ export async function getMojiaSkuSyncConfig() {
|
||||
return unwrapApiResponse(response)
|
||||
}
|
||||
|
||||
export async function testLingxingConnection(skuCode: string) {
|
||||
const response = await http.post<ApiEnvelope<LingxingConnectionTestResult>, ApiEnvelope<LingxingConnectionTestResult>>(
|
||||
`${basePath}/test-connection`, { skuCode },
|
||||
)
|
||||
return unwrapApiResponse(response)
|
||||
}
|
||||
|
||||
export async function updateMojiaSkuSync(id: string, data: {
|
||||
skuCode: string
|
||||
lengthCm: number
|
||||
|
||||
Reference in New Issue
Block a user