diff --git a/src/components/donors/DonorDonations.svelte b/src/components/donors/DonorDonations.svelte index edd7f0dc..d37fe051 100644 --- a/src/components/donors/DonorDonations.svelte +++ b/src/components/donors/DonorDonations.svelte @@ -17,10 +17,10 @@ > {:else} {$_("fixed-donation")}: - {(d.amount / 100) + {(donation.amount / 100) .toFixed(2) .toLocaleString("de-DE", { valute: "EUR" })}€ diff --git a/src/components/donors/DonorsOverview.svelte b/src/components/donors/DonorsOverview.svelte index c9ef3b98..1708300c 100644 --- a/src/components/donors/DonorsOverview.svelte +++ b/src/components/donors/DonorsOverview.svelte @@ -25,7 +25,6 @@ import { filterAddress, filterName } from "../shared/tablefilters"; $: searchvalue = ""; $: active_deletes = []; - $: current_donations = []; $: selectedDonors = $table?.getSelectedRowModel().rows.map((row) => row.original) || []; $: selected = @@ -71,13 +70,10 @@ filterFn: `address`, }, { - accessorKey: "sponsorings", + accessorKey: "donations", header: () => $_("sponsorings"), cell: (info) => { - const donations = current_donations.filter( - (d) => d?.donor?.id == info.row.original.id - ); - return renderComponent(DonorDonations, { donations }); + return renderComponent(DonorDonations, { donations: info.getValue() }); }, enableColumnFilter: false, }, @@ -153,16 +149,11 @@ let page = 0; while (page >= 0) { const donors = await DonorService.donorControllerGetAll(page, 500); - const donations = await DonationService.donationControllerGetAll( - page, - 500 - ); - if (donors.length == 0 && donations.length == 0) { + if (donors.length == 0) { page = -2; } current_donors = current_donors.concat(...donors); - current_donations = current_donations.concat(...donors); options.update((options) => ({ ...options, data: current_donors,