From 9e1e561accd52c800afd6dd91123c6ffb012b82d Mon Sep 17 00:00:00 2001 From: Kamila Date: Wed, 24 Jul 2024 13:21:45 +0200 Subject: [PATCH] rework component --- .../components/CreationTransactionList.vue | 172 +++++++++--------- 1 file changed, 84 insertions(+), 88 deletions(-) diff --git a/admin/src/components/CreationTransactionList.vue b/admin/src/components/CreationTransactionList.vue index eb954f313..079e8f4f0 100644 --- a/admin/src/components/CreationTransactionList.vue +++ b/admin/src/components/CreationTransactionList.vue @@ -1,16 +1,17 @@ + - + { + key: 'contributionDate', + label: t('transactionlist.period'), + }, + { + key: 'confirmedAt', + label: t('transactionlist.confirmed'), + formatter: (value) => { + return value ? new Date(value).toLocaleDateString() : null; + }, + }, + { + key: 'status', + label: t('transactionlist.status'), + }, + { + key: 'amount', + label: t('transactionlist.amount'), + formatter: (value) => { + return `${value} GDD`; + }, + }, + { key: 'memo', label: t('transactionlist.memo'), class: 'text-break' }, +]; + +const { result, refetch } = useQuery(adminListContributions, { + currentPage: currentPage.value, + pageSize: perPage.value, + order: 'DESC', + userId: props.userId, +}); + +watch(result, (newResult) => { + if (newResult && newResult.adminListContributions) { + rows.value = newResult.adminListContributions.contributionCount; + items.value = newResult.adminListContributions.contributionList; + } +}); + +watch(currentPage, () => { + refetch(); +}); +s \ No newline at end of file