feat(delivery): let customers read and download signed receipts
This commit is contained in:
@@ -1,4 +1,31 @@
|
||||
import { apiRequest } from '@/api/http'
|
||||
import { apiBlobRequest, apiRequest } from '@/api/http'
|
||||
|
||||
export interface DeliveryReceiptFile {
|
||||
fileId: string
|
||||
fileName: string
|
||||
contentType: string | null
|
||||
sizeBytes: number
|
||||
uploadedAt: string
|
||||
}
|
||||
|
||||
export interface DeliveryReceipts {
|
||||
deliveryNo: string
|
||||
files: DeliveryReceiptFile[]
|
||||
}
|
||||
|
||||
export function getDeliveryReceipts(deliveryNo: string) {
|
||||
return apiRequest<DeliveryReceipts>({
|
||||
method: 'GET',
|
||||
url: `/merchant/v1/last-leg/delivery-orders/${encodeURIComponent(deliveryNo)}/documents/receipt`,
|
||||
})
|
||||
}
|
||||
|
||||
export function downloadDeliveryReceipt(deliveryNo: string, fileId: string) {
|
||||
return apiBlobRequest({
|
||||
method: 'GET',
|
||||
url: `/merchant/v1/last-leg/delivery-orders/${encodeURIComponent(deliveryNo)}/documents/receipt/files/${encodeURIComponent(fileId)}/download`,
|
||||
})
|
||||
}
|
||||
|
||||
export interface PageResult<T> {
|
||||
records: T[]
|
||||
|
||||
Reference in New Issue
Block a user