some-improvement
This commit is contained in:
@@ -401,20 +401,20 @@ export async function getInvoices(status?: string): Promise<{ results: Invoice[]
|
||||
}
|
||||
|
||||
export async function getInvoice(invoiceId: number): Promise<Invoice> {
|
||||
return fetchAPI(`/v1/billing/v2/invoices/${invoiceId}/`);
|
||||
return fetchAPI(`/v1/billing/invoices/${invoiceId}/`);
|
||||
}
|
||||
|
||||
export async function downloadInvoicePDF(invoiceId: number): Promise<Blob> {
|
||||
const response = await fetch(`/api/v1/billing/v2/invoices/${invoiceId}/download_pdf/`, {
|
||||
const response = await fetch(`/api/v1/billing/invoices/${invoiceId}/download_pdf/`, {
|
||||
headers: {
|
||||
Authorization: `Bearer ${localStorage.getItem('access_token')}`,
|
||||
},
|
||||
});
|
||||
|
||||
|
||||
if (!response.ok) {
|
||||
throw new Error('Failed to download invoice');
|
||||
}
|
||||
|
||||
|
||||
return response.blob();
|
||||
}
|
||||
|
||||
@@ -424,7 +424,7 @@ export async function downloadInvoicePDF(invoiceId: number): Promise<Blob> {
|
||||
|
||||
export async function getPayments(status?: string): Promise<{ results: Payment[]; count: number }> {
|
||||
const params = status ? `?status=${status}` : '';
|
||||
return fetchAPI(`/v1/billing/v2/payments/${params}`);
|
||||
return fetchAPI(`/v1/billing/payments/${params}`);
|
||||
}
|
||||
|
||||
export async function getAvailablePaymentMethods(): Promise<{
|
||||
@@ -434,7 +434,7 @@ export async function getAvailablePaymentMethods(): Promise<{
|
||||
bank_transfer: boolean;
|
||||
local_wallet: boolean;
|
||||
}> {
|
||||
return fetchAPI('/v1/billing/v2/payments/available_methods/');
|
||||
return fetchAPI('/v1/billing/payments/available_methods/');
|
||||
}
|
||||
|
||||
export async function createManualPayment(data: {
|
||||
@@ -447,7 +447,7 @@ export async function createManualPayment(data: {
|
||||
status: string;
|
||||
message: string;
|
||||
}> {
|
||||
return fetchAPI('/v1/billing/v2/payments/create_manual_payment/', {
|
||||
return fetchAPI('/v1/billing/payments/create_manual_payment/', {
|
||||
method: 'POST',
|
||||
body: JSON.stringify(data),
|
||||
});
|
||||
@@ -477,7 +477,7 @@ export async function getPendingPayments(): Promise<{
|
||||
results: PendingPayment[];
|
||||
count: number;
|
||||
}> {
|
||||
return fetchAPI('/v1/billing/v2/admin/pending_payments/');
|
||||
return fetchAPI('/v1/billing/admin/pending_payments/');
|
||||
}
|
||||
|
||||
export async function approvePayment(
|
||||
@@ -488,7 +488,7 @@ export async function approvePayment(
|
||||
status: string;
|
||||
message: string;
|
||||
}> {
|
||||
return fetchAPI(`/v1/billing/v2/admin/${paymentId}/approve_payment/`, {
|
||||
return fetchAPI(`/v1/billing/admin/${paymentId}/approve_payment/`, {
|
||||
method: 'POST',
|
||||
body: JSON.stringify({ notes }),
|
||||
});
|
||||
@@ -502,7 +502,7 @@ export async function rejectPayment(
|
||||
status: string;
|
||||
message: string;
|
||||
}> {
|
||||
return fetchAPI(`/v1/billing/v2/admin/${paymentId}/reject_payment/`, {
|
||||
return fetchAPI(`/v1/billing/admin/${paymentId}/reject_payment/`, {
|
||||
method: 'POST',
|
||||
body: JSON.stringify({ reason }),
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user