Add:
- (user)/donation/[id]/(transaction-flow)/[invoiceId]

Fix:
Integrasi dalam alur transaksi
- Buat invoice dan list transaksi

### No Issue
This commit is contained in:
2025-10-07 17:40:54 +08:00
parent 7c82e8b588
commit a980397640
11 changed files with 284 additions and 86 deletions

View File

@@ -103,20 +103,63 @@ export async function apiDonationUpdateData({
}
}
export async function apiDonationGetAll() {
export async function apiDonationGetAll({
category,
authorId,
}: {
category: "beranda" | "my-donation";
authorId?: string;
}) {
const authorQuery = authorId ? `&authorId=${authorId}` : "";
try {
const response = await apiConfig.get(`/mobile/donation`);
const response = await apiConfig.get(
`/mobile/donation?category=${category}${authorQuery}`
);
return response.data;
} catch (error) {
throw error;
}
}
export async function apiDonationFundrising({id}: {id: string}) {
try {
const response = await apiConfig.get(`/mobile/donation/${id}/fundrising`);
return response.data;
} catch (error) {
throw error;
}
export async function apiDonationFundrising({ id }: { id: string }) {
try {
const response = await apiConfig.get(`/mobile/donation/${id}/fundrising`);
return response.data;
} catch (error) {
throw error;
}
}
export async function apiDonationCreateDonatur({
id,
data,
}: {
id: string;
data: any;
}) {
try {
const response = await apiConfig.post(`/mobile/donation/${id}/donatur`, {
data: data,
});
return response.data;
} catch (error) {
throw error;
}
}
export async function apiDonationCreateInvoice({
id,
data,
}: {
id: string;
data: any;
}) {
try {
const response = await apiConfig.post(`/mobile/donation/${id}/invoice`, {
data: data,
});
return response.data;
} catch (error) {
throw error;
}
}