base commit
This commit is contained in:
@@ -46,6 +46,7 @@ export type AdminOrderDetailResponse = {
|
||||
id: string
|
||||
authorType: string
|
||||
text: string
|
||||
attachmentUrl?: string | null
|
||||
createdAt: string
|
||||
}>
|
||||
}
|
||||
|
||||
@@ -39,6 +39,7 @@ export type OrderDetailResponse = {
|
||||
id: string
|
||||
authorType: string
|
||||
text: string
|
||||
attachmentUrl?: string | null
|
||||
createdAt: string
|
||||
}>
|
||||
}
|
||||
@@ -68,8 +69,17 @@ export async function postOrderMessage(id: string, text: string): Promise<void>
|
||||
await apiClient.post(`me/orders/${id}/messages`, { text })
|
||||
}
|
||||
|
||||
export async function payOrderStub(id: string): Promise<{ ok: boolean; status: string }> {
|
||||
const { data } = await apiClient.post<{ ok: boolean; status: string }>(`me/orders/${id}/pay`)
|
||||
/** Подтверждение оплаты переводом: multipart detail + необязательный файл receipt (хотя бы одно нужно на сервере). */
|
||||
export async function submitOrderPayment(
|
||||
orderId: string,
|
||||
payload: { detail: string; receiptFile: File | null },
|
||||
): Promise<{ ok: boolean; status: string }> {
|
||||
const formData = new FormData()
|
||||
formData.append('detail', payload.detail)
|
||||
if (payload.receiptFile) {
|
||||
formData.append('receipt', payload.receiptFile)
|
||||
}
|
||||
const { data } = await apiClient.post<{ ok: boolean; status: string }>(`me/orders/${orderId}/pay`, formData)
|
||||
return data
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user