优化
This commit is contained in:
@@ -7,6 +7,7 @@ import type {
|
||||
ConfirmedPackageCountRequest,
|
||||
SaveInboundMeasurementDraftRequest,
|
||||
SubmitInboundMeasurementRequest,
|
||||
ManualCartonScanRequest,
|
||||
} from './types'
|
||||
|
||||
function measurementPath(inboundId: string) {
|
||||
@@ -67,6 +68,23 @@ export async function submitInboundMeasurement(
|
||||
return unwrapApiResponse(response)
|
||||
}
|
||||
|
||||
export async function createManualCartonScan(
|
||||
customerId: string,
|
||||
inboundId: string,
|
||||
payload: ManualCartonScanRequest,
|
||||
image: File,
|
||||
) {
|
||||
const data = new FormData()
|
||||
data.append('data', new Blob([JSON.stringify(payload)], { type: 'application/json' }))
|
||||
data.append('image', image)
|
||||
const response = await http.post<ApiEnvelope<CartonMeasurementResult>, ApiEnvelope<CartonMeasurementResult>>(
|
||||
`${measurementPath(inboundId)}/carton-scans`,
|
||||
data,
|
||||
{ params: { tenantId: customerId }, headers: { 'Content-Type': 'multipart/form-data' } },
|
||||
)
|
||||
return unwrapApiResponse(response)
|
||||
}
|
||||
|
||||
export function downloadInboundMeasurementImage(customerId: string, inboundId: string, fileId: string) {
|
||||
return http.get<Blob, Blob>(
|
||||
`/platform/v1/files/measurements/${segment(customerId)}/${segment(inboundId)}/${segment(fileId)}`,
|
||||
|
||||
Reference in New Issue
Block a user