From b53546de4711e6db529be914c5ce5bce3432d571 Mon Sep 17 00:00:00 2001 From: Kamila Date: Wed, 24 Jul 2024 13:45:30 +0200 Subject: [PATCH] rework component --- admin/src/components/TransactionLinkList.vue | 161 +++++++++---------- 1 file changed, 72 insertions(+), 89 deletions(-) diff --git a/admin/src/components/TransactionLinkList.vue b/admin/src/components/TransactionLinkList.vue index d829002c3..9dc2d1693 100644 --- a/admin/src/components/TransactionLinkList.vue +++ b/admin/src/components/TransactionLinkList.vue @@ -1,106 +1,89 @@ - +]) + +const { result, error, refetch } = useQuery(listTransactionLinksAdmin, () => ({ + currentPage: currentPage.value, + pageSize: perPage.value, + userId: props.userId, +})); + +watch(result, (newResult) => { + if (newResult && newResult.listTransactionLinksAdmin) { + rows.value = newResult.listTransactionLinksAdmin.count + items.value = newResult.listTransactionLinksAdmin.links + } +}) + +watch(error, (err) => { + if (err) { + // toast.error(error.message) + } +}) + +watch([currentPage, perPage], () => { + refetch() +}) + \ No newline at end of file