优化
This commit is contained in:
@@ -465,3 +465,19 @@ export async function createFinanceCost(payload: Record<string, unknown>, vouche
|
||||
const response = await http.post<ApiEnvelope<FinanceCostResource>, ApiEnvelope<FinanceCostResource>>(`${basePath}/cost-entries`, { ...payload, currency: 'CNY', voucherFileIds }, { headers: { 'Idempotency-Key': idempotencyKey('cost') } })
|
||||
return unwrapApiResponse(response)
|
||||
}
|
||||
|
||||
export interface FinancePaymentVoucher {
|
||||
fileId: string
|
||||
fileName: string
|
||||
contentType: string
|
||||
sizeBytes: number
|
||||
}
|
||||
export async function getFinancePaymentVoucher(customerId: string, fileId: string): Promise<FinancePaymentVoucher> {
|
||||
return unwrapApiResponse(await http.get<ApiEnvelope<FinancePaymentVoucher>, ApiEnvelope<FinancePaymentVoucher>>(
|
||||
`${basePath}/vouchers/${encodeURIComponent(fileId)}`, { params: { customerId } }))
|
||||
}
|
||||
export function downloadFinancePaymentVoucher(customerId: string, fileId: string): Promise<Blob> {
|
||||
return http.get<Blob, Blob>(`${basePath}/vouchers/${encodeURIComponent(fileId)}/content`, {
|
||||
params: { customerId }, responseType: 'blob',
|
||||
})
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user