Integrasi API: Donation & Admin Donation
Fix: - app/(application)/(user)/donation/[id]/(transaction-flow)/[invoiceId]/invoice.tsx - app/(application)/(user)/donation/[id]/index.tsx - app/(application)/admin/donation/[id]/[status]/index.tsx - app/(application)/admin/donation/[id]/[status]/transaction-detail.tsx - app/(application)/admin/donation/[id]/list-of-donatur.tsx - components/Select/SelectCustom.tsx - context/AuthContext.tsx - screens/Donation/BoxPublish.tsx - screens/Donation/ProgressSection.tsx - service/api-admin/api-admin-donation.ts ### NO Issue
This commit is contained in:
@@ -53,11 +53,50 @@ export async function apiAdminDonationListOfDonatur({
|
||||
status,
|
||||
}: {
|
||||
id: string;
|
||||
status: "berhasil" | "gagal" | "proses" | "menunggu" | "";
|
||||
status: "berhasil" | "gagal" | "proses" | "menunggu" | null;
|
||||
}) {
|
||||
const query = status && status !== null ? `?status=${status}` : "";
|
||||
|
||||
try {
|
||||
const response = await apiConfig.get(
|
||||
`/mobile/admin/donation/${id}/donatur?status=${status}`
|
||||
`/mobile/admin/donation/${id}/donatur${query}`
|
||||
);
|
||||
return response.data;
|
||||
} catch (error) {
|
||||
throw error;
|
||||
}
|
||||
}
|
||||
|
||||
export async function apiAdminDonationInvoiceDetailById({
|
||||
id,
|
||||
}: {
|
||||
id: string;
|
||||
}) {
|
||||
try {
|
||||
const response = await apiConfig.get(
|
||||
`/mobile/admin/donation/${id}/invoice`
|
||||
);
|
||||
return response.data;
|
||||
} catch (error) {
|
||||
throw error;
|
||||
}
|
||||
}
|
||||
|
||||
export async function apiAdminDonationInvoiceUpdateById({
|
||||
id,
|
||||
data,
|
||||
status,
|
||||
}: {
|
||||
id: string;
|
||||
data: any;
|
||||
status: "berhasil" | "gagal" | "proses" | "menunggu";
|
||||
}) {
|
||||
try {
|
||||
const response = await apiConfig.put(
|
||||
`/mobile/admin/donation/${id}/invoice?status=${status}`,
|
||||
{
|
||||
data: data,
|
||||
}
|
||||
);
|
||||
return response.data;
|
||||
} catch (error) {
|
||||
|
||||
Reference in New Issue
Block a user