diff --git a/src/components/donations/AddDonationModal.svelte b/src/components/donations/AddDonationModal.svelte
index ab9dd2a2..63e781e3 100644
--- a/src/components/donations/AddDonationModal.svelte
+++ b/src/components/donations/AddDonationModal.svelte
@@ -15,7 +15,7 @@
option.firstname + " " + (option.middlename || "") + " " + option.lastname;
const filterDonors = (label, filterText, option) =>
label.toLowerCase().includes(filterText.toLowerCase()) ||
- option.id.toString().startsWith(filterText.toLowerCase());
+ option.value.id.toString().startsWith(filterText.toLowerCase());
function focus(el) {
el.focus();
}
@@ -25,12 +25,14 @@
$: runners = [];
$: is_fixed = false;
DonorService.donorControllerGetAll().then((val) => {
- donors = val;
- donor = donors[0].id || 0;
+ donors = val.map((r) => {
+ return { label: getDonorLabel(r), value: r };
+ });
});
RunnerService.runnerControllerGetAll().then((val) => {
- runners = val;
- runner = runners[0].id || 0;
+ runners = val.map((r) => {
+ return { label: getDonorLabel(r), value: r };
+ });
});
$: amount_input = 0;
$: processed_last_submit = true;
@@ -184,7 +186,6 @@
-
{#if is_fixed}
{$_('create-a-new-fixed-donation')}
{:else}{$_('create-a-new-distance-donation')}{/if}
@@ -213,15 +214,13 @@
class="block text-sm font-medium text-gray-700">{$_('donor')}
{#if !is_fixed}
@@ -230,15 +229,13 @@
class="block text-sm font-medium text-gray-700">{$_('runner')}
{/if}